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

relay: don't expect that serverdata['channels'] is always present

This commit is contained in:
James Lu 2016-06-27 23:00:39 -07:00
parent 01d462c97f
commit 8b39635fa8

View File

@ -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...