guard around potential crashes

This commit is contained in:
2026-09-02 18:38:38 +02:00
parent 9c3fd4c1a2
commit e98293fa7c
5 changed files with 32 additions and 16 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ export function getStreams(): StreamSummary[] {
stream_date: Date.parse(stream.stream_date as string),
filename: stream.filename as string,
title: stream.title as string | null,
tags: JSON.parse(stream.tags as string) as string[],
tags: (JSON.parse(stream.tags as string) as string[]) ?? [],
length_seconds: stream.length_seconds as number
}));
}
@@ -40,7 +40,7 @@ export function getStreamInfo(streamId: string): Stream | null {
format: streamData.format as string,
title: streamData.title as string | null,
description: streamData.description as string | null,
tags: JSON.parse(streamData.tags as string) as string[],
tags: (JSON.parse(streamData.tags as string) as string[]) ?? [],
length_seconds: streamData.length_seconds as number,
tracks: JSON.parse(streamData.tracks as string)
};