protect against invalid posts

(???) i dont quite understand why i have to do this but some server is
throwing posts at me without an id or a status or much of anything so..
This commit is contained in:
codl 2017-09-21 06:50:01 +02:00
parent fd0bd49bdd
commit 4e5c2b1f9a
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
1 changed files with 2 additions and 0 deletions

View File

@ -128,6 +128,8 @@ def fetch_acc(acc, cursor=None):
kwargs['max_id'] = +inf
for status in statuses:
if 'id' not in status.keys():
continue
post = post_from_api_object(status, acc.mastodon_instance)
db.session.merge(post)
kwargs['max_id'] = min(kwargs['max_id'], status['id'])