refactor: add guards around trivial index checks

This commit is contained in:
Carlos Valente
2025-12-11 17:59:46 +01:00
committed by Carlos Valente
parent 242cefd35c
commit 426d42ab63
7 changed files with 35 additions and 8 deletions
+3 -1
View File
@@ -28,7 +28,9 @@ export function loadRoll(
let daySpan = 0;
for (let i = 0; i < metadata.playableEventOrder.length; i++) {
const event = rundown.entries[metadata.playableEventOrder[i]] as PlayableEvent;
const eventId = metadata.playableEventOrder[i];
if (!eventId) continue;
const event = rundown.entries[eventId] as PlayableEvent;
// rolling into events of 0 duration would make the playback be stuck
if (event.duration === 0) {
continue;