Browse files

Convert list index out of range check to try/except

  • Loading branch information...
1 parent 05c6e34 commit 631b9e0c8761fc491bfb171aced1ad817ebd1cb1 @atoponce committed Sep 4, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 email-0mq.py
View
8 email-0mq.py
@@ -23,12 +23,12 @@
f.write(msg)
f.close()
- # Ignore client events that aren't PUBLIC
- if not y['tags'][3]:
+ try:
+ nick = base64.b64decode(y['tags'][3])
+ nick = re.sub('^nick_','',nick)
+ except:
continue
- nick = base64.b64decode(y['tags'][3])
- nick = re.sub('^nick_','',nick)
message = base64.b64decode(y['message'])
# Change your email-to-sms address as provided by your mobile provider

0 comments on commit 631b9e0

Please sign in to comment.