From e2080fb25a1d136e9a6118620d2cabd97aa05f88 Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Tue, 1 Oct 2024 11:24:49 -0400 Subject: [PATCH] validate data from api to prevent crash on episode list --- source/Main.bs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/Main.bs b/source/Main.bs index 33c3ba856..042ee6565 100644 --- a/source/Main.bs +++ b/source/Main.bs @@ -224,8 +224,12 @@ sub Main (args as dynamic) as void ' Find the object in the scene's data and update its json data for i = 0 to currentScene.objects.Items.count() - 1 if LCase(currentScene.objects.Items[i].id) = LCase(currentEpisode.id) - currentScene.objects.Items[i].json = api.users.GetItem(m.global.session.user.id, currentEpisode.id) - m.global.queueManager.callFunc("setTopStartingPoint", currentScene.objects.Items[i].json.UserData.PlaybackPositionTicks) + + data = api.users.GetItem(m.global.session.user.id, currentEpisode.id) + if isValid(data) + currentScene.objects.Items[i].json = data + m.global.queueManager.callFunc("setTopStartingPoint", data.UserData.PlaybackPositionTicks) + end if exit for end if end for