Make _notif_timeline_generator more robust

Notifications without statuses shouldn't crash
This commit is contained in:
Daniel Schwarz 2023-02-24 22:51:27 -05:00
parent 744dc090b4
commit 8ee414c83a
1 changed files with 5 additions and 2 deletions

View File

@ -290,8 +290,11 @@ def _timeline_generator(app, user, path, params=None):
def _notif_timeline_generator(app, user, path, params=None):
while path:
response = http.get(app, user, path, params)
notif = response.json()
statuses = [n['status'] for n in notif]
notification = response.json()
statuses = []
for n in notification:
if n['status']:
statuses.append(n['status'])
yield statuses
path = _get_next_path(response.headers)