diff --git a/src/sessionmanager/session.py b/src/sessionmanager/session.py index 676c69bd..054f30bb 100644 --- a/src/sessionmanager/session.py +++ b/src/sessionmanager/session.py @@ -455,9 +455,12 @@ class Session(object): if long != False and config.app["app-settings"]["handle_longtweets"]: tweet["message"] = twishort.get_full_text(long) tweet["twishort"] = True - for i in tweet["entities"]["user_mentions"]: - if "@%s" % (i["screen_name"] not in tweet["message"]) and i["screen_name"] != tweet["user"]["screen_name"]: - if tweet.has_key("retweeted_status") and tweet["retweeted_status"]["user"]["screen_name"] == i["screen_name"]: - continue - tweet["message"] = u"@%s %s" % (i["screen_name"], tweet["message"]) + try: + for i in tweet["entities"]["user_mentions"]: + if "@%s" % (i["screen_name"] not in tweet["message"]) and i["screen_name"] != tweet["user"]["screen_name"]: + if tweet.has_key("retweeted_status") and tweet["retweeted_status"]["user"]["screen_name"] == i["screen_name"]: + continue + tweet["message"] = u"@%s %s" % (i["screen_name"], tweet["message"]) + except TypeError: + pass return tweet \ No newline at end of file