From 1bbbce13af93bd2aef8443bb5e654f7259377ab8 Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Sat, 1 Feb 2025 14:42:33 -0500 Subject: [PATCH] ui: guard against typeerror when setting the value of a control box --- lib/solaar/ui/config_panel.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/solaar/ui/config_panel.py b/lib/solaar/ui/config_panel.py index 5eed08110..588ceccf7 100644 --- a/lib/solaar/ui/config_panel.py +++ b/lib/solaar/ui/config_panel.py @@ -715,7 +715,10 @@ def _update_setting_item(sbox, value, is_online=True, sensitive=True, null_okay= return sbox._failed.set_visible(False) sbox._control.set_sensitive(False) - sbox._control.set_value(value) + try: # a call was producing a TypeError so guard against that + sbox._control.set_value(value) + except TypeError as e: + logger.warning("%s: error setting control value (%s): %s", sbox.setting.name, sbox.setting._device, repr(e)) sbox._control.set_sensitive(sensitive is True) _change_icon(sensitive, sbox._change_icon)