From 2c5f2c594a6135d79b69b6d6b73dbfe7c78ebb97 Mon Sep 17 00:00:00 2001 From: Abdessamad Haddouche Date: Sun, 31 May 2026 17:03:11 +0100 Subject: [PATCH] fix: guard against index out of range when post has no body text --- video_creation/final_video.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/video_creation/final_video.py b/video_creation/final_video.py index a0e38a2..d20c98d 100644 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -371,6 +371,8 @@ def make_final_video( # Fraction-based — compute from audio duration audio_idx = entry["audio_idx"] time_fraction = entry["time_fraction"] + if audio_idx + 1 >= len(audio_clips_durations): + break audio_dur = audio_clips_durations[audio_idx + 1] display_dur = audio_dur * time_fraction offset = audio_time_used.get(audio_idx, 0.0)