Skip to content

Commit

Permalink
Remove a non-null assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
3flex authored Nov 3, 2024
1 parent 6ac3432 commit 6e27fc7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/maincontroller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 6e27fc7

Please sign in to comment.