Skip to content

Commit fddbdd0

Browse files
committed
Fixing Sentry #OPENSHOT-4D: Couldn't apply 'update' to update listener: <windows.models.properties_model.PropertiesModel object at 0x000002407f9bf4c0>. list index out of range. This was mostly caused by "load" UpdateActions, which have an empty list as a key.
1 parent 10a24e5 commit fddbdd0

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

src/windows/models/properties_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class PropertiesModel(updates.UpdateInterface):
7070
def changed(self, action):
7171

7272
# Handle change
73-
if action.key and action.key[0] in ["clips", "effects"] and action.type in ["update", "insert"]:
73+
if len(action.key) >= 1 and action.key[0] in ["clips", "effects"] and action.type in ["update", "insert"]:
7474
log.debug(action.values)
7575
# Update the model data
7676
self.update_model(get_app().window.txtPropertyFilter.text())

src/windows/video_widget.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class VideoWidget(QWidget, updates.UpdateInterface):
5252
# This method is invoked by the UpdateManager each time a change happens (i.e UpdateInterface)
5353
def changed(self, action):
5454
# Handle change
55-
if (action.key and action.key[0] in [
55+
if (len(action.key) >= 1 and action.key[0] in [
5656
"display_ratio", "pixel_ratio"
5757
] or action.type in ["load"]):
5858
# Update display ratio (if found)

src/windows/views/timeline.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def changed(self, action):
134134
return
135135

136136
# Bail out if change unrelated to webview
137-
if action.key and action.key[0] not in ["clips", "effects", "duration", "layers", "markers"]:
137+
if len(action.key) >= 1 and action.key[0] not in ["clips", "effects", "duration", "layers", "markers"]:
138138
log.debug(f"Skipping unneeded webview update for '{action.key[0]}'")
139139
return
140140

src/windows/views/timeline_backend/qwidget.py

+4
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ def get_html(self):
122122

123123
# This method is invoked by the UpdateManager each time a change happens (i.e UpdateInterface)
124124
def changed(self, action):
125+
# Ignore changes that don't affect this
126+
if action and len(action.key) >= 1 and action.key[0].lower() in ["files", "history", "profile"]:
127+
return
128+
125129
# Clear previous rects
126130
self.clip_rects.clear()
127131
self.clip_rects_selected.clear()

src/windows/views/zoom_slider.py

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ class ZoomSlider(QWidget, updates.UpdateInterface):
4646

4747
# This method is invoked by the UpdateManager each time a change happens (i.e UpdateInterface)
4848
def changed(self, action):
49+
# Ignore changes that don't affect this
50+
if action and len(action.key) >= 1 and action.key[0].lower() in ["files", "history", "profile"]:
51+
return
52+
4953
# Clear previous rects
5054
self.clip_rects.clear()
5155
self.clip_rects_selected.clear()

0 commit comments

Comments
 (0)