From c2075492ec479f3989998cc13a9b7b1bfb200fe5 Mon Sep 17 00:00:00 2001 From: Orfeas <40646079+OrpheusGr@users.noreply.github.com> Date: Sun, 1 Sep 2024 01:56:38 +0300 Subject: [PATCH] Fix for empty quit message When a quit occurs and there is no quit message len(arguments) is 0 (arguments is an empty list) and so this line in _handle_other "arguments = [arguments[0]]" causes an "IndexError". as i also posted here: https://github.com/jaraco/irc/issues/210 --- irc/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/irc/client.py b/irc/client.py index 8e16700..f99fce9 100644 --- a/irc/client.py +++ b/irc/client.py @@ -411,7 +411,10 @@ def _handle_message(self, arguments, command, source, tags): def _handle_other(self, arguments, command, source, tags): target = None if command == "quit": - arguments = [arguments[0]] + if len(arguments) > 0: + arguments = [arguments[0]] + else: + arguments = [""] elif command == "ping": target = arguments[0] else: