diff --git a/twoot.py b/twoot.py index 180cca1..6afc449 100755 --- a/twoot.py +++ b/twoot.py @@ -975,7 +975,12 @@ def main(argv): in_db_cnt = 0 for replied_to_tweet, status in timeline: # Extract tweet ID and status ID - tweet_id = status.find('a', class_='tweet-link').get('href').strip('#m') + tweet_link_tag = status.find('a', class_='tweet-link') + if tweet_link_tag is None: + logging.debug("Malformed timeline item (no tweet link), skipping") + continue + + tweet_id = tweet_link_tag.get('href').strip('#m') status_id = tweet_id.split('/')[3] logging.debug('processing tweet %s', tweet_id)