From 123bfe3266ed5dc9325665561b66e8bc132d6f7b Mon Sep 17 00:00:00 2001 From: hrshtmk Date: Sun, 20 Sep 2026 23:47:40 +0530 Subject: [PATCH] fix(tui): avoid NoMatches exception when SelectionList is missing on key events --- archinstall/tui/components.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/archinstall/tui/components.py b/archinstall/tui/components.py index 03349c9022..63d9cfd83e 100644 --- a/archinstall/tui/components.py +++ b/archinstall/tui/components.py @@ -567,9 +567,9 @@ def on_mount(self) -> None: self.query_one(SelectionList).focus() def on_key(self, event: Key) -> None: - selection_list = self.query_one(SelectionList) - - if not selection_list.has_focus or event.key != 'enter': + # Safely query SelectionList to avoid NoMatches crashes during screen transitions or key events. + selection_list = self.query(SelectionList).first() + if not selection_list or not selection_list.has_focus or event.key != 'enter': return if len(self._selected_items) < 1: