From bd294cce837c9611aa727e838851daa4bab76c1a Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Fri, 16 Apr 2021 15:17:55 -0700 Subject: [PATCH] Check if obj exists for updates --- bookwyrm/activitypub/verbs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bookwyrm/activitypub/verbs.py b/bookwyrm/activitypub/verbs.py index 400939d0b..442e38583 100644 --- a/bookwyrm/activitypub/verbs.py +++ b/bookwyrm/activitypub/verbs.py @@ -58,7 +58,9 @@ class Update(Verb): def action(self): """ update a model instance from the dataclass """ - self.object.to_model(allow_create=False) + obj = self.object + if obj: + self.object.to_model(allow_create=False) @dataclass(init=False)