diff --git a/protocols/inspircd.py b/protocols/inspircd.py index aaa2b51..16cc456 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -198,7 +198,11 @@ def handle_part(irc, source, command, args): irc.channels[channel].users.remove(source) if not irc.channels[channel].users: del irc.channels[channel] - return {'channel': channel, 'reason': args[1]} + try: + reason = args[1] + except IndexError: + reason = '' + return {'channel': channel, 'reason': reason} def handle_error(irc, numeric, command, args): irc.connected = False