From 3907777c912c98e89650a91eda306da96d32243e Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Fri, 5 Jan 2024 11:13:37 -0600 Subject: [PATCH] fix: Handle empty notifications --- src/sessions/mastodon/session.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sessions/mastodon/session.py b/src/sessions/mastodon/session.py index 005b7939..1253e527 100644 --- a/src/sessions/mastodon/session.py +++ b/src/sessions/mastodon/session.py @@ -135,6 +135,10 @@ class Session(base.baseSession): else: last_id = self.db[name][-1].id for i in data: + # handle empty notifications. + post_types = ["status", "mention", "reblog", "favourite", "update", "poll"] + if hasattr(i, "type") and i.type in post_types and i.status == None: + continue if ignore_older and last_id != None: if i.id < last_id: log.error("Ignoring an older tweet... Last id: {0}, tweet id: {1}".format(last_id, i.id))