Skip to content

Commit

Permalink
ui: guard against typeerror when setting the value of a control box
Browse files Browse the repository at this point in the history
  • Loading branch information
pfps committed Feb 1, 2025
1 parent 722a3d7 commit 1bbbce1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/solaar/ui/config_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 1bbbce1

Please sign in to comment.