From 59b0b5c99107208b699b721e97897fc9d3246b92 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 5 Apr 2015 17:13:26 -0700 Subject: [PATCH] RelayNext: fix check for disconnected networks --- RelayNext/plugin.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/RelayNext/plugin.py b/RelayNext/plugin.py index 4b528bc..4fe7fb2 100644 --- a/RelayNext/plugin.py +++ b/RelayNext/plugin.py @@ -251,11 +251,11 @@ class RelayNext(callbacks.Plugin): targets.remove(source) for cn in targets: target, net = cn.split("@") - try: - otherIrc = world.getIrc(net) - except KeyError: - self.log.debug("RelayNext: message to %s dropped, we " - "are not connected there!", net) + otherIrc = world.getIrc(net) + if otherIrc is None: + self.log.debug("RelayNext: message to network %r" + " dropped, we are not connected " + "there!", net) else: out_msg = ircmsgs.privmsg(target, out_s) out_msg.tag('relayedMsg')