diff --git a/src/components/maincontroller.ts b/src/components/maincontroller.ts index 485aa9e0..685df040 100644 --- a/src/components/maincontroller.ts +++ b/src/components/maincontroller.ts @@ -412,10 +412,9 @@ export function setSubtitleStreamIndex( return; } - const mediaStreams = state.PlaybackMediaSource?.MediaStreams; + const mediaStreams = state.PlaybackMediaSource?.MediaStreams ?? []; - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const subtitleStream = getStreamByIndex(mediaStreams!, 'Subtitle', index); + const subtitleStream = getStreamByIndex(mediaStreams, 'Subtitle', index); if (!subtitleStream) { console.log(