From b3dbe922dea2cea9190d1583bd6b69f1a45d6b90 Mon Sep 17 00:00:00 2001 From: wakonig_k Date: Sun, 27 Apr 2025 13:50:43 +0200 Subject: [PATCH] fix(launch_window): return None when cancelling the ui file launcher --- bec_widgets/applications/launch_window.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bec_widgets/applications/launch_window.py b/bec_widgets/applications/launch_window.py index 1aad9f5c..28f688bc 100644 --- a/bec_widgets/applications/launch_window.py +++ b/bec_widgets/applications/launch_window.py @@ -210,7 +210,7 @@ class LaunchWindow(BECMainWindow): name: str | None = None, geometry: tuple[int, int, int, int] | None = None, **kwargs, - ) -> QWidget: + ) -> QWidget | None: """Launch the specified script. If the launch script creates a QWidget, it will be embedded in a BECMainWindow. If the launch script creates a BECMainWindow, it will be shown as a separate window. @@ -246,6 +246,8 @@ class LaunchWindow(BECMainWindow): if launch_script == "custom_ui_file": ui_file = kwargs.pop("ui_file", None) + if not ui_file: + return None return self._launch_custom_ui_file(ui_file) if launch_script == "auto_update":