Fix airbag deployment on empty messages
PTGbot airbag deploys on empty messages (messages containing only spaces, or /me actions). Fix this crash to avoid airbag deployment. Change-Id: I4def945894419536fd3d340e3850007210adf17f
This commit is contained in:
parent
b728b153e4
commit
5a791cde41
|
@ -133,6 +133,12 @@ class PTGBot(SASL, SSL, irc.bot.SingleServerIRCBot):
|
|||
|
||||
def handle_public_command(self, chan, nick, args):
|
||||
words = args.split()
|
||||
|
||||
# Some messages are empty or only contain spaces.
|
||||
# Do nothing in that case.
|
||||
if not words:
|
||||
return
|
||||
|
||||
cmd = words[0].lower()
|
||||
|
||||
if len(cmd) > 1 and cmd[1:] == 'help':
|
||||
|
|
Loading…
Reference in New Issue