Merge pull request #19 from jr-k/bugfix/null-safe-selectables-variable

Null safe check for Variable selectables field
This commit is contained in:
JRK 2024-05-05 18:52:56 +02:00 committed by GitHub
commit b0b484c2b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -127,6 +127,7 @@ class Variable:
value = self.eval() value = self.eval()
if self.type == VariableType.SELECT_SINGLE: if self.type == VariableType.SELECT_SINGLE:
if isinstance(self._selectables, list):
for selectable in self.selectables: for selectable in self.selectables:
if selectable.key == value: if selectable.key == value:
return str(selectable.label) return str(selectable.label)