From 9a3c7a3f854fe6666c4ce1928045499ffa24aa27 Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Tue, 1 Oct 2024 14:14:08 -0400 Subject: [PATCH] validate user setting data to prevent crash --- components/home/HomeItem.bs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/home/HomeItem.bs b/components/home/HomeItem.bs index 797e253c1..1917c5b00 100644 --- a/components/home/HomeItem.bs +++ b/components/home/HomeItem.bs @@ -83,7 +83,8 @@ sub itemContentChanged() if LCase(itemData.type) = "series" if isValid(localGlobal) and isValid(localGlobal.session) and isValid(localGlobal.session.user) and isValid(localGlobal.session.user.settings) - if not localGlobal.session.user.settings["ui.tvshows.disableUnwatchedEpisodeCount"] + unwatchedEpisodeCountSetting = localGlobal.session.user.settings["ui.tvshows.disableUnwatchedEpisodeCount"] + if isValid(unwatchedEpisodeCountSetting) and not unwatchedEpisodeCountSetting if isValid(itemData.json.UserData) and isValid(itemData.json.UserData.UnplayedItemCount) if itemData.json.UserData.UnplayedItemCount > 0 if isValid(m.unplayedCount) then m.unplayedCount.visible = true