Protect against empty privmsgs
authorStefan Hajnoczi <stefanha@gmail.com>
Sun, 28 Jun 2009 16:20:56 +0000 (17:20 +0100)
committerStefan Hajnoczi <stefanha@gmail.com>
Sun, 28 Jun 2009 16:20:56 +0000 (17:20 +0100)
gpxebot.py

index a20920a..45f11a8 100755 (executable)
@@ -50,7 +50,6 @@ def do_response(response):
         return False
     if isinstance(response, list):
         return any(do_response(r) for r in response)
-    print response
     (command, args) = response
     if command == 'PRIVMSG':
         pmsg(*args)
@@ -68,6 +67,8 @@ def privmsg(_, target, msg):
     utils.do_log(cmds.logs, target, who.nick, msg)
 
     words = msg.split()
+    if not words:
+        return False
     if target.startswith('#'):
         replyto = target
         if not config.NICK in words[0]: