From cf05473c2c8a4d60d2683b2ffb44d5d687f0da14 Mon Sep 17 00:00:00 2001 From: moneromooo Date: Thu, 15 Jan 2015 11:21:16 +0000 Subject: [PATCH] Handle IRC input without a channel (eg, QUIT) --- tipbot/ircutils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tipbot/ircutils.py b/tipbot/ircutils.py index 96d5991..e7e6b72 100644 --- a/tipbot/ircutils.py +++ b/tipbot/ircutils.py @@ -330,7 +330,10 @@ def IRCLoop(on_idle,on_identified,on_command): parts = cparts[0].split(' ') who = parts[0] action = parts[1] - chan = parts[2] + if len(parts) >= 3: + chan = parts[2] + else: + chan = None except Exception, e: log_error('main parser: Exception, continuing: %s' % str(e)) continue