Skip to content

Commit

Permalink
Fix for combo box with no options
Browse files Browse the repository at this point in the history
  • Loading branch information
machinewrapped committed May 13, 2024
1 parent 68188f2 commit ee157a5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion GUI/Widgets/OptionsWidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ def __init__(self, key, values, initial_value, tooltip = None):
self.combo_box.currentTextChanged.connect(self.contentChanged)

def GetValue(self):
return GetValueFromName(self.combo_box.currentText(), self.values)
value = self.combo_box.currentText()
if value and self.values:
return GetValueFromName(value, self.values)
return None

def SetValue(self, value):
self.combo_box.setCurrentIndex(self.combo_box.findText(value))
Expand Down

0 comments on commit ee157a5

Please sign in to comment.