From 3537bd34abe0ee5e4965b711ad7d6e66b69bf541 Mon Sep 17 00:00:00 2001 From: codl Date: Wed, 2 Aug 2017 06:19:08 +0200 Subject: [PATCH] dont crash when there are no posts to refresh --- lib/twitter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/twitter.py b/lib/twitter.py index 4685083..821a0a5 100644 --- a/lib/twitter.py +++ b/lib/twitter.py @@ -113,6 +113,9 @@ def fetch_acc(account, cursor, consumer_key=None, consumer_secret=None): def refresh_posts(posts): + if not posts: + return posts + t = get_twitter_for_acc(posts[0].author) tweets = t.statuses.lookup(_id=",".join((post.twitter_id for post in posts)), trim_user = True, tweet_mode = 'extended')