From dde60c9fd0591d5032796253ee2651738675d2f8 Mon Sep 17 00:00:00 2001 From: Jimi Date: Sat, 30 Apr 2022 07:02:03 -0600 Subject: [PATCH] Prevent crashes. --- components/tvshows/TVEpisodeRowWithOptions.brs | 2 +- source/Main.brs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/tvshows/TVEpisodeRowWithOptions.brs b/components/tvshows/TVEpisodeRowWithOptions.brs index 34af25bb..5b663944 100644 --- a/components/tvshows/TVEpisodeRowWithOptions.brs +++ b/components/tvshows/TVEpisodeRowWithOptions.brs @@ -35,7 +35,7 @@ end sub ' 'Check if options updated and any reloading required sub audioOptionsClosed() - if m.tvListOptions.audioStreamIndex <> m.top.selectedAudioStreamIndex + if m.currentSelected <> invalid and m.tvListOptions.audioStreamIndex <> m.top.selectedAudioStreamIndex m.top.objects.items[m.currentSelected].selectedAudioStreamIndex = m.tvListOptions.audioStreamIndex end if end sub diff --git a/source/Main.brs b/source/Main.brs index f3f2f3af..d219254a 100644 --- a/source/Main.brs +++ b/source/Main.brs @@ -88,7 +88,7 @@ sub Main (args as dynamic) as void itemNode = reportingNode.quickPlayNode if itemNode = invalid or itemNode.id = "" then return if itemNode.type = "Episode" or itemNode.type = "Movie" or itemNode.type = "Video" - if itemNode.type = "Episode" and itemNode.selectedAudioStreamIndex > 1 + if itemNode.type = "Episode" and itemNode.selectedAudioStreamIndex <> invalid and itemNode.selectedAudioStreamIndex > 1 video = CreateVideoPlayerGroup(itemNode.id, invalid, itemNode.selectedAudioStreamIndex) else video = CreateVideoPlayerGroup(itemNode.id) @@ -107,7 +107,7 @@ sub Main (args as dynamic) as void ' play episode ' todo: create an episode page to link here video_id = selectedItem.id - if selectedItem.selectedAudioStreamIndex > 1 + if selectedItem.selectedAudioStreamIndex <> invalid and selectedItem.selectedAudioStreamIndex > 1 video = CreateVideoPlayerGroup(video_id, invalid, selectedItem.selectedAudioStreamIndex) else video = CreateVideoPlayerGroup(video_id) @@ -170,7 +170,7 @@ sub Main (args as dynamic) as void ' If you select a TV Episode from ANYWHERE, follow this flow node = getMsgPicker(msg, "picker") video_id = node.id - if node.selectedAudioStreamIndex > 1 + if node.selectedAudioStreamIndex <> invalid and node.selectedAudioStreamIndex > 1 video = CreateVideoPlayerGroup(video_id, invalid, node.selectedAudioStreamIndex) else video = CreateVideoPlayerGroup(video_id)