Let's avoid an assertion error by making sure we don't use empty msg's

This commit is contained in:
James Vega 2004-08-28 21:12:44 +00:00
parent 0349d11853
commit b6d28d7560

View File

@ -486,6 +486,9 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp):
payload = payload[:-len(irc.nick)]
payload = payload.strip(', ') # Strip punctuation separating nick.
payload += '?' # So doUnknown gets called.
if not payload.strip():
self.log.debug('Bailing since we received an empty msg.')
return
msg = ircmsgs.privmsg(msg.args[0], payload, prefix=msg.prefix)
callbacks.PrivmsgCommandAndRegexp.doPrivmsg(self, irc, msg)
finally: