Modules: avoid unhandled exception in all_post

This commit is contained in:
nemunaire 2015-10-13 07:49:53 +02:00
commit 76ec0d26b4
3 changed files with 3 additions and 7 deletions

View file

@ -79,14 +79,12 @@ def parselisten(msg):
def parseresponse(msg):
global LAST_SUBS
try:
if hasattr(msg, "text") and msg.text:
urls = re.findall("www.reddit.com(/\w/\w+/?)", msg.text)
for url in urls:
for recv in msg.receivers:
if recv not in LAST_SUBS:
LAST_SUBS[recv] = list()
LAST_SUBS[recv].append(url)
except:
pass
return msg