Fixed issue with bot crashing when processing a None message (#49)

Fixes #46
pull/53/head
Russell 2019-02-08 14:25:49 -05:00 committed by Mal Hancock
parent 39be6ea582
commit 7c7d92948a
1 changed files with 2 additions and 0 deletions

View File

@ -237,6 +237,8 @@ class Bot(irc.bot.SingleServerIRCBot):
self.process_output(c, chan, output) self.process_output(c, chan, output)
def process_output(self, c, chan, output): def process_output(self, c, chan, output):
if not output.msg:
return
for msg in output.msg: for msg in output.msg:
if len(msg.encode('UTF-8')) > 512: if len(msg.encode('UTF-8')) > 512:
self.logger.error('output message too long: {}'.format(msg)) self.logger.error('output message too long: {}'.format(msg))