From 8faec714bb0a373c8f1295508b86c18f2fe3607a Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 3 Apr 2021 11:39:29 -0700 Subject: [PATCH] Safely return unread count when key is unset --- bookwyrm/activitystreams.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/activitystreams.py b/bookwyrm/activitystreams.py index d9236ec9..094cbafd 100644 --- a/bookwyrm/activitystreams.py +++ b/bookwyrm/activitystreams.py @@ -83,7 +83,7 @@ class ActivityStream(ABC): def get_unread_count(self, user): """ get the unread status count for this user's feed """ - return int(r.get(self.unread_id(user))) + return int(r.get(self.unread_id(user)) or 0) def populate_stream(self, user): """ go from zero to a timeline """