Merge pull request #861 from mouse-reeve/unread-count-error

Safely return unread count when key is unset
This commit is contained in:
Mouse Reeve 2021-04-03 11:53:12 -07:00 committed by GitHub
commit e51a287cd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 """