Skip to content

Commit 8c4c769

Browse files
committed
Fixing Sentry #OPENSHOT-F2: IndexError: list index out of range when populating property model.
1 parent 7e2146d commit 8c4c769

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/windows/models/properties_model.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,9 @@ def set_property(self, property, filter, c, item_type, object_id=None):
702702

703703
selected_choice = None
704704
if choices:
705-
selected_choice = [c for c in choices if c["selected"] is True][0]["name"]
705+
selected_choices = [c for c in choices if c.get("selected") is True]
706+
if selected_choices:
707+
selected_choice = selected_choices[0]["name"]
706708

707709
# Hide filtered out properties
708710
if filter and filter.lower() not in _(label).lower():

0 commit comments

Comments
 (0)