From 10b5fe072367ffc964e36a7a21ec809bdfd7f239 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 10 May 2021 20:10:21 +0000 Subject: [PATCH] tui: Fix return values when the callback wasn't callable Signed-off-by: Michael Tremer --- src/python/tui.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/python/tui.py b/src/python/tui.py index 19a646e..4988b69 100644 --- a/src/python/tui.py +++ b/src/python/tui.py @@ -238,7 +238,11 @@ class ButtonsWindow(Window): return callback() # Otherwise call the default action - return self.default_action() + elif callback is None: + return self.default_action() + + # Or just return the value + return callback # If any of the callbacks raise TryAgain, we go back and let the user # edit the form again -- 2.47.2