From baf5403066cb854ed07360105bba7e13dc0e5a16 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Thu, 22 Sep 2011 14:29:29 -0400 Subject: [PATCH] fix nonetype issues --- irc.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/irc.py b/irc.py index 3a6ce19..266ad04 100755 --- a/irc.py +++ b/irc.py @@ -15,8 +15,11 @@ class Origin(object): source = re.compile(r'([^!]*)!?([^@]*)@?(.*)') def __init__(self, bot, source, args): - source = source.decode('utf-8') - match = Origin.source.match(source or '') + if source: + source = source.decode('utf-8') + else: + source = "" + match = Origin.source.match(source) self.nick, self.user, self.host = match.groups() if len(args) > 1: