From 1f957741316f0fd995f23631ed540ba799f1b449 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 13 Sep 2015 17:04:17 -0700 Subject: [PATCH] inspircd: add proper fallback value for OPERTYPE? --- protocols/inspircd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/protocols/inspircd.py b/protocols/inspircd.py index f0122c9..ec52fec 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -187,7 +187,7 @@ def nickClient(irc, numeric, newnick): def _operUp(irc, target, opertype=None): userobj = irc.users[target] try: - otype = opertype or userobj.opertype + otype = opertype or userobj.opertype or 'IRC_Operator' except AttributeError: log.debug('(%s) opertype field for %s (%s) isn\'t filled yet!', irc.name, target, userobj.nick) @@ -195,6 +195,7 @@ def _operUp(irc, target, opertype=None): otype = 'IRC_Operator' log.debug('(%s) Sending OPERTYPE from %s to oper them up.', irc.name, target) + assert otype, "Tried to send an empty OPERTYPE!" userobj.opertype = otype _send(irc, target, 'OPERTYPE %s' % otype)