dont crash when there are no posts to refresh

This commit is contained in:
codl 2017-08-02 06:19:08 +02:00
parent e08a0eea13
commit 3537bd34ab
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
1 changed files with 3 additions and 0 deletions

View File

@ -113,6 +113,9 @@ def fetch_acc(account, cursor, consumer_key=None, consumer_secret=None):
def refresh_posts(posts): def refresh_posts(posts):
if not posts:
return posts
t = get_twitter_for_acc(posts[0].author) t = get_twitter_for_acc(posts[0].author)
tweets = t.statuses.lookup(_id=",".join((post.twitter_id for post in posts)), tweets = t.statuses.lookup(_id=",".join((post.twitter_id for post in posts)),
trim_user = True, tweet_mode = 'extended') trim_user = True, tweet_mode = 'extended')