Skip to content

Commit

Permalink
Protect from generating a waveform for a NULL clip (we should skip cl…
Browse files Browse the repository at this point in the history
…ips that we can't find or query). Reported in Sentry: OPENSHOT-1WJ5
  • Loading branch information
jonoomph committed Apr 16, 2023
1 parent 266092e commit 150689f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/classes/waveform.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ def getAudioData(file, channel=-1, tid=None):
for clip_id in clip_list:
clip = Clip.get(id=clip_id)

if not clip:
# Ignore null clip
log.debug(f"No clip found for ID: {clip_id}. Skipping waveform generation.")
continue

# Check for channel mapping and filters
channel_filter = int(clip.data.get("channel_filter", {}).get("Points", [])[0].get("co", {}).get("Y", -1))
if channel_filter != -1:
Expand Down

0 comments on commit 150689f

Please sign in to comment.