From 1c321409b8018a3d8ac60897ad1dc331d4ca1838 Mon Sep 17 00:00:00 2001 From: James Vega Date: Mon, 1 Aug 2011 17:17:22 -0400 Subject: [PATCH] Topic: Ensure do315's response is for a channel in our state object Signed-off-by: James Vega (cherry picked from commit 44eb449ba41b37f3fa5e9f63575c696f38d4707c) Signed-off-by: Daniel Folkinshteyn --- plugins/Topic/plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/Topic/plugin.py b/plugins/Topic/plugin.py index a9e50ab93..d7d9463e1 100644 --- a/plugins/Topic/plugin.py +++ b/plugins/Topic/plugin.py @@ -236,7 +236,9 @@ class Topic(callbacks.Plugin): def do315(self, irc, msg): # Try to restore the topic when not set yet. channel = msg.args[1] - c = irc.state.channels[channel] + c = irc.state.channels.get(channel) + if c is None: + return if irc.nick not in c.ops and 't' in c.modes: self.log.debug('Not trying to restore topic in %s. I\'m not opped ' 'and %s is +t.', channel, channel)