Fix traceback if bot is kicked immediately after joining a channel.

This commit is contained in:
Valentin Lorentz 2013-07-13 12:01:53 +02:00
parent 3bfa4ae35a
commit 9bfec720f5

View File

@ -518,7 +518,13 @@ class IrcState(IrcCommandDispatcher):
def do367(self, irc, msg): def do367(self, irc, msg):
# Example: # Example:
# :server 367 user #chan some!random@user evil!channel@op 1356276459 # :server 367 user #chan some!random@user evil!channel@op 1356276459
try:
state = self.channels[msg.args[1]] state = self.channels[msg.args[1]]
except KeyError:
# We have been kicked of the channel before the server replied to
# the MODE +b command.
pass
else:
state.bans.add(msg.args[2]) state.bans.add(msg.args[2])
def doMode(self, irc, msg): def doMode(self, irc, msg):