Don't assume a given mode is in IRCChannel.modes when we check to see if a given

mode has any arguments against it
This commit is contained in:
jesopo 2018-11-26 13:39:26 +00:00
parent 426c6ff1c9
commit 6d6bfa3262

View file

@ -77,7 +77,7 @@ class Channel(IRCObject.Object):
del self.user_modes[user]
else:
self.modes[mode].discard(arg.lower())
if not len(self.modes[mode]):
if mode in self.modes and not len(self.modes[mode]):
del self.modes[mode]
def change_mode(self, remove: bool, mode: str, arg: str=None):
if remove: