Fix exception on empty message

This commit is contained in:
nemunaire 2014-08-04 02:32:29 +02:00
commit b34a73cea6
2 changed files with 4 additions and 3 deletions

View file

@ -154,7 +154,8 @@ def treat_variables(res):
return True
def treat_alias(msg, hooks_cache):
if msg.cmd == "PRIVMSG" and (len(msg.cmds[0]) > 0 and msg.cmds[0][0] == "!"
if msg.cmd == "PRIVMSG" and len(msg.cmds) > 0 and (len(msg.cmds[0]) > 0
and msg.cmds[0][0] == "!"
and msg.cmds[0][1:] in DATAS.getNode("aliases").index
and msg.cmds[0][1:] not in hooks_cache("cmd_hook")):
msg.content = msg.content.replace(msg.cmds[0],