Skip to content

Commit 75738b5

Browse files
committed
fix(lsg): fix crash on rundowns containing empty parts
1 parent 8fc2c31 commit 75738b5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/live-status-gateway/src/topics/helpers/part/partStatus.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ export function toExtendedPartStatus(
4646
name: part.title,
4747
autoNext: part.autoNext,
4848
segmentId: unprotectString(part.segmentId),
49-
pieces: piecesByPartId[unprotectString(part._id)].map((piece) => toPieceStatus(piece, showStyleBaseExt)),
49+
pieces: (piecesByPartId[unprotectString(part._id)] ?? []).map((piece) =>
50+
toPieceStatus(piece, showStyleBaseExt)
51+
),
5052
publicData: part.publicData,
5153
}
5254

packages/live-status-gateway/src/topics/helpers/segment/segmentStatus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function toExtendedSegmentStatus(
4545

4646
return {
4747
...segmentStatus,
48-
parts: partsBySegmentId[segmentId]
48+
parts: (partsBySegmentId[segmentId] ?? [])
4949
.map((part) => toExtendedPartStatus(cache, part))
5050
.filter((part) => part !== null),
5151
}

0 commit comments

Comments
 (0)