Don't assume a reconnect timer event will always have connection_params

This commit is contained in:
jesopo 2018-11-14 13:08:57 +00:00
parent 76d9face44
commit 99c2147512

View file

@ -130,7 +130,8 @@ class Bot(object):
del self.servers[server.fileno()]
def _timed_reconnect(self, event: EventManager.Event):
if not self.reconnect(event["server_id"], event["connection_params"]):
if not self.reconnect(event["server_id"],
event.get("connection_params", None)):
event["timer"].redo()
def reconnect(self, server_id: int, connection_params: typing.Optional[
utils.irc.IRCConnectionParameters]=None) -> bool: