From bc94d782900d8e4e4486a9d52d8a99812bd59d38 Mon Sep 17 00:00:00 2001 From: Adam McKellar Date: Sun, 3 Nov 2024 14:13:28 +0100 Subject: [PATCH] fix: crash when clicking on empty controller list --- gamepadla_plus/gui.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gamepadla_plus/gui.py b/gamepadla_plus/gui.py index de88492..017f340 100644 --- a/gamepadla_plus/gui.py +++ b/gamepadla_plus/gui.py @@ -269,9 +269,10 @@ def update_result_table(data: dict): update_joysticks() elif event == "-GAMEPAD-LIST-": - clicked_string = values["-GAMEPAD-LIST-"][0] - if clicked_string != "": - selected_joystick = int(clicked_string.split(".")[0]) + if len(values["-GAMEPAD-LIST-"]) > 0: + clicked_string = values["-GAMEPAD-LIST-"][0] + if clicked_string != "": + selected_joystick = int(clicked_string.split(".")[0]) elif event == "-START-TEST-BUTTON-": if len(joysticks) == 0: