3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 09:19:23 +01:00

utils: actually abort when mode target is invalid

This commit is contained in:
James Lu 2016-03-26 17:58:03 -07:00
parent 9cd1635f68
commit 2169a9be28

View File

@ -203,6 +203,7 @@ def parseModes(irc, target, args):
if target not in irc.users:
log.warning('(%s) Possible desync! Mode target %s is not in the users index.', irc.name, target)
return [] # Return an empty mode list
supported_modes = irc.umodes
oldmodes = irc.users[target].modes
@ -211,6 +212,7 @@ def parseModes(irc, target, args):
if target not in irc.channels:
log.warning('(%s) Possible desync! Mode target %s is not in the channels index.', irc.name, target)
return []
supported_modes = irc.cmodes
oldmodes = irc.channels[target].modes