Skip to content

Commit

Permalink
Merge pull request #666 from 3flex/patch-3
Browse files Browse the repository at this point in the history
Remove a non-null assertion
  • Loading branch information
nielsvanvelzen authored Nov 3, 2024
2 parents aa84761 + 6e27fc7 commit cfa3de8
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 cfa3de8

Please sign in to comment.