From 8b39635fa8a4b92feb6a4e435fc86c9b4115f318 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 27 Jun 2016 23:00:39 -0700 Subject: [PATCH] relay: don't expect that serverdata['channels'] is always present --- plugins/relay.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/relay.py b/plugins/relay.py index 4c0b6b9..0ee996a 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -467,7 +467,7 @@ def removeChannel(irc, channel): if irc is None: return - if channel not in map(str.lower, irc.serverdata['channels']): + if channel not in map(str.lower, irc.serverdata.get('channels', [])): world.services['pylink'].extra_channels[irc.name].discard(channel) irc.proto.part(irc.pseudoclient.uid, channel, 'Channel delinked.') @@ -479,7 +479,7 @@ def removeChannel(irc, channel): # Don't ever part the main client from any of its autojoin channels. else: if user == irc.pseudoclient.uid and channel in \ - irc.serverdata['channels']: + irc.serverdata.get('channels', []): continue irc.proto.part(user, channel, 'Channel delinked.') # Don't ever quit it either...