Skip to content

Commit

Permalink
validate user setting data to prevent crash
Browse files Browse the repository at this point in the history
  • Loading branch information
cewert committed Oct 1, 2024
1 parent d7c99f5 commit 9a3c7a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/home/HomeItem.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9a3c7a3

Please sign in to comment.