Refactor loop to handle empty sequence case

Adjusted loop to handle empty current sequence by appending an empty list if no tracks are present.
This commit is contained in:
Jakub Jezek 2024-06-05 12:48:37 +02:00
parent fbacbec94e
commit 3e86be2783
No known key found for this signature in database
GPG key ID: 06DBD609ADF27FD9

View file

@ -130,7 +130,7 @@ def ls():
all_items = lib.get_track_items()
# append all video tracks
for track in lib.get_current_sequence():
for track in (lib.get_current_sequence() or []):
if type(track) != hiero.core.VideoTrack:
continue
all_items.append(track)