mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-02 15:44:06 +01:00
Fix for KeyError escaping from stats.
This commit is contained in:
parent
de7da5abc1
commit
32eb85e3c5
@ -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)
|
||||
|
@ -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:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user