From d8eb3454d6baab01db1a17a7c9bb856d1c03f1f7 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 3 Jan 2021 20:03:35 -0800 Subject: [PATCH] Fixes null value in status attachment array --- bookwyrm/models/status.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py index 10cee7525..2494c4582 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -118,7 +118,7 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel): activity['attachment'] = [ image_serializer(b.cover, b.alt_text) \ for b in self.mention_books.all()[:4] if b.cover] - if hasattr(self, 'book'): + if hasattr(self, 'book') and self.book.cover: activity['attachment'].append( image_serializer(self.book.cover, self.book.alt_text) )