Skip to content

Commit d37894c

Browse files
committed
Extending objects protections to color_update and remove_keyframe methods - to ignore when an object_id is not found, or a clip has no 'objects' dict
1 parent 36d9b36 commit d37894c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/windows/models/properties_model.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,11 @@ def remove_keyframe(self, item):
208208
# Create reference
209209
clip_data = c.data
210210
if object_id:
211-
clip_data = c.data.get('objects').get(object_id)
211+
objects = c.data.get('objects', {})
212+
clip_data = objects.pop(object_id, {})
213+
if not clip_data:
214+
log.debug("No clip data found for this object id")
215+
return
212216

213217
if property_key in clip_data: # Update clip attribute
214218
log_id = "{}/{}".format(clip_id, object_id) if object_id else clip_id
@@ -331,7 +335,11 @@ def color_update(self, item, new_color, interpolation=-1, interpolation_details=
331335
# Create reference
332336
clip_data = c.data
333337
if object_id:
334-
clip_data = c.data.get('objects').get(object_id)
338+
objects = c.data.get('objects', {})
339+
clip_data = objects.pop(object_id, {})
340+
if not clip_data:
341+
log.debug("No clip data found for this object id")
342+
return
335343

336344
# Update clip attribute
337345
if property_key in clip_data:

0 commit comments

Comments
 (0)