ShrinkUrl: Preven crash for commands with no arguments.

This commit is contained in:
Valentin Lorentz 2015-11-11 12:15:55 +00:00
parent 567def69c3
commit c65762544c

View File

@ -124,8 +124,10 @@ class ShrinkUrl(callbacks.PluginRegexp):
irc.queueMsg(newMsg) irc.queueMsg(newMsg)
def outFilter(self, irc, msg): def outFilter(self, irc, msg):
if msg.command != 'PRIVMSG':
return
channel = msg.args[0] channel = msg.args[0]
if msg.command == 'PRIVMSG' and irc.isChannel(channel): if irc.isChannel(channel):
if not msg.shrunken: if not msg.shrunken:
if self.registryValue('outFilter', channel): if self.registryValue('outFilter', channel):
if utils.web.httpUrlRe.search(msg.args[1]): if utils.web.httpUrlRe.search(msg.args[1]):