From 5a0f96fc8eae06d3d74f014c7d22c1789f851d8f Mon Sep 17 00:00:00 2001 From: James Vega Date: Wed, 2 Sep 2009 07:40:33 -0400 Subject: [PATCH] Reply with an error when getBanmask doesn't have a valid channel. Signed-off-by: James Vega (cherry picked from commit 459bc616b1c19b6d5f96a7a3ae5916777637f42f) --- src/commands.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands.py b/src/commands.py index eee35c6c2..ef7a61466 100644 --- a/src/commands.py +++ b/src/commands.py @@ -280,7 +280,10 @@ def getBanmask(irc, msg, args, state): getChannel(irc, msg, args, state) channel = state.channel banmaskstyle = conf.supybot.protocols.irc.banmask - state.args[-1] = banmaskstyle.makeBanmask(state.args[-1]) + try: + state.args[-1] = banmaskstyle.makeBanmask(state.args[-1]) + except AssertionError: + state.errorInvalid('channel', channel) def getUser(irc, msg, args, state): try: