From b43d714011c93fca141bc9fe05a1f4439ea59e39 Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 8 Sep 2016 18:45:34 -0700 Subject: [PATCH] clientbot: ignore WHO replies for clients we don't know This fixes various KeyErrors, etc. when processing the WHO reply later on, as Clientbot doesn't track state for anyone who doesn't share a channel with or talks to the bot. Reported by Kev`Bz via IRC. --- protocols/clientbot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/protocols/clientbot.py b/protocols/clientbot.py index 8b882ad..abe2d10 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -451,6 +451,10 @@ class ClientbotWrapperProtocol(Protocol): realname = args[-1].split(' ', 1)[-1] uid = self.irc.nickToUid(nick) + if uid is None: + log.debug("(%s) Ignoring extraneous /WHO info for %s", self.irc.name, nick) + return + self.updateClient(uid, 'IDENT', ident) self.updateClient(uid, 'HOST', host) self.updateClient(uid, 'GECOS', realname)