Skip to content

Commit

Permalink
add validation to prevent crash
Browse files Browse the repository at this point in the history
  • Loading branch information
cewert committed Jul 28, 2024
1 parent c030228 commit 190d9b0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/ItemGrid/LoadVideoContentTask.bs
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,12 @@ sub addAudioStreamsToVideo(video)
end sub

sub addSubtitlesToVideo(video, meta)
if not isValid(meta) then return
if not isValid(meta.id) then return
if not isValid(m.playbackInfo) then return
if not isValidAndNotEmpty(m.playbackInfo.MediaSources) then return
if not isValid(m.playbackInfo.MediaSources[0].MediaStreams) then return

subtitles = sortSubtitles(meta.id, m.playbackInfo.MediaSources[0].MediaStreams)
safesubs = subtitles["all"]
subtitleTracks = []
Expand Down

0 comments on commit 190d9b0

Please sign in to comment.