From 3002ce0a59155cce731d31fdb2e9e508fd1340fb Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Tue, 1 Oct 2024 19:48:31 -0400 Subject: [PATCH] validate we have data from api to prevent crash --- components/data/PersonData.bs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/data/PersonData.bs b/components/data/PersonData.bs index 71745b06..48058fb0 100644 --- a/components/data/PersonData.bs +++ b/components/data/PersonData.bs @@ -4,9 +4,12 @@ import "pkg:/source/utils/config.bs" sub setFields() json = m.top.json + m.top.Type = "Person" + + if json = invalid then return + m.top.id = json.id m.top.favorite = json.UserData.isFavorite - m.top.Type = "Person" setPoster() end sub