mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-02 07:34:08 +01:00
Safety catch for inconsistent wordstats/users databases.
This commit is contained in:
parent
d077e9a3fe
commit
8df8c27a66
@ -250,7 +250,12 @@ class WordStats(callbacks.Privmsg):
|
||||
for (userid, count) in self.db.getTopUsers(channel, word, n):
|
||||
if userid == id:
|
||||
rank = None
|
||||
username = ircdb.users.getUser(userid).name
|
||||
try:
|
||||
username = ircdb.users.getUser(userid).name
|
||||
except KeyError:
|
||||
irc.error('Odd, I have a user in my WordStats database '
|
||||
'that doesn\'t exist in the user database.')
|
||||
return
|
||||
L.append('%s: %s' % (username, count))
|
||||
ret = 'Top %s (out of a total of %s seen):' % \
|
||||
(utils.nItems(ers, len(L)), utils.nItems(repr(word), total))
|
||||
|
Loading…
Reference in New Issue
Block a user