]> git.ipfire.org Git - people/ms/bricklayer.git/commitdiff
TUI: Ignore the default value if it does not exist
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 25 Feb 2023 12:17:04 +0000 (12:17 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 25 Feb 2023 12:17:04 +0000 (12:17 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/tui.py

index 3bb91aaa8bfe330e345e8d285178f01946e1a529..1b635a8d7d319698339fc336cc798eb01c825876 100644 (file)
@@ -309,6 +309,10 @@ class SelectWindow(ButtonsWindow):
                super().__init__(tui, title, text, buttons=buttons,
                        height=height, width=width, help=help)
 
+               # Reset default it is not part of the items
+               if not default in items:
+                       default = None
+
                self.items = items
                self.default = default
                self.multi = multi