From 94f284567a762a41b2c3ee1fb2a37bb863f94e35 Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Mon, 4 Sep 2023 13:12:38 -0400 Subject: [PATCH] prevent crash when language is invalid --- components/ItemGrid/LoadVideoContentTask.brs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/ItemGrid/LoadVideoContentTask.brs b/components/ItemGrid/LoadVideoContentTask.brs index 0cf47b14..50a97855 100644 --- a/components/ItemGrid/LoadVideoContentTask.brs +++ b/components/ItemGrid/LoadVideoContentTask.brs @@ -405,8 +405,10 @@ function FindPreferredAudioStream(streams as dynamic) as integer if preferredLanguage <> invalid for i = 0 to streams.Count() - 1 - if LCase(streams[i].Type) = "audio" and LCase(streams[i].Language) = LCase(preferredLanguage) - return i + if LCase(streams[i].Type) = "audio" + if streams[i].Language <> invalid and LCase(streams[i].Language) = LCase(preferredLanguage) + return i + end if end if end for end if