From 4ceaa48d9a5b7001ba703eb8873fb4d4445e5ae2 Mon Sep 17 00:00:00 2001 From: James O'SHANNESSY <12959316+joshanne@users.noreply.github.com> Date: Wed, 30 Jul 2025 12:47:18 +1000 Subject: [PATCH] gui: fixes a forever loop when a malformed interface is specified If you used an argument that results in the device failing to open, it falls through to Exception. If the exception occurs, you can result in a forever loop where the interface was set at the command line, but the device fails to open. If an exception occurs, force a return to the setup window, with cleared iface and args. --- dronecan_gui_tool/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dronecan_gui_tool/main.py b/dronecan_gui_tool/main.py index 611ffc2..7885aa8 100644 --- a/dronecan_gui_tool/main.py +++ b/dronecan_gui_tool/main.py @@ -653,6 +653,10 @@ def main(): except Exception as ex: logger.error('DroneCAN node init failed', exc_info=True) show_error('Fatal error', 'Could not initialize DroneCAN node', ex, blocking=True) + + # An exception occurred, so reset args and the interface and return to the setup window + args.interface = None + iface = None else: break