Fix for KeyError escaping from stats.

This commit is contained in:
Jeremy Fincher 2003-10-02 00:43:38 +00:00
parent de7da5abc1
commit 32eb85e3c5
2 changed files with 4 additions and 1 deletions

View File

@ -393,8 +393,8 @@ class ChannelDB(callbacks.PrivmsgCommandAndRegexp, ChannelDBHandler):
channel = privmsgs.getChannel(msg, args)
name = privmsgs.getArgs(args)
if not ircdb.users.hasUser(name):
hostmask = irc.state.nickToHostmask(name)
try:
hostmask = irc.state.nickToHostmask(name)
name = ircdb.users.getUser(hostmask).name
except KeyError:
irc.error(msg, conf.replyNoUser)

View File

@ -42,6 +42,9 @@ class ChannelDBTestCase(ChannelPluginTestCase, PluginDocumentation):
self.assertRegexp('seen asldfkjasdlfkj', 'I have not seen')
self.assertNotRegexp('seen asldfkjasdlfkj', 'KeyError')
def testNoKeyErrorStats(self):
self.assertNotRegexp('stats sweede', 'KeyError')
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: