Misc: Handle KeyError in 'completenick'. Closes GH-315.

This commit is contained in:
nyuszika7h 2012-02-25 20:56:44 +08:00 committed by Valentin Lorentz
parent 99ad2d193e
commit 5b0faad2f9
1 changed files with 2 additions and 0 deletions

View File

@ -515,6 +515,8 @@ class Misc(callbacks.Plugin):
Returns the nick of someone on the channel whose nick begins with the
given <beginning>.
<channel> defaults to the current channel."""
if channel not in irc.state.channels:
irc.error(_('I\'m not even in %s.') % channel, Raise=True)
if ('match-case', True) in optlist:
def match(nick):
return nick.startswith(beginning)