From 2e0a5e52e241e56f451d8a52fc61640129bdae2f Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 14 Sep 2015 17:55:58 -0700 Subject: [PATCH] utils.parseModes: fix IndexError on empty query --- utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/utils.py b/utils.py index 69ae101..a8d26fd 100644 --- a/utils.py +++ b/utils.py @@ -170,11 +170,10 @@ def parseModes(irc, target, args): # B = Mode that changes a setting and always has a parameter. # C = Mode that changes a setting and only has a parameter when set. # D = Mode that changes a setting and never has a parameter. + assert args, 'No valid modes were supplied!' usermodes = not isChannel(target) prefix = '' modestring = args[0] - if not modestring: - return ValueError('No modes supplied in parseModes query: %r' % modes) args = args[1:] if usermodes: log.debug('(%s) Using irc.umodes for this query: %s', irc.name, irc.umodes)