From 9c701f946d35506619376998e305f5d0f6146798 Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Sat, 20 Jul 2024 10:48:23 -0400 Subject: [PATCH 1/2] validate data to prevent app crash --- components/data/TVEpisodeData.bs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/data/TVEpisodeData.bs b/components/data/TVEpisodeData.bs index 8991446a3..993b34721 100644 --- a/components/data/TVEpisodeData.bs +++ b/components/data/TVEpisodeData.bs @@ -1,4 +1,7 @@ +import "pkg:/source/utils/misc.bs" + sub setFields() + if not isValid(m.top.json) then return datum = m.top.json m.top.id = datum.id From f5e765b3f2c9e5fd375268392c94f97a02db4131 Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Sat, 20 Jul 2024 10:49:23 -0400 Subject: [PATCH 2/2] use isValid() --- components/data/TVEpisodeData.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/data/TVEpisodeData.bs b/components/data/TVEpisodeData.bs index 993b34721..df979dd59 100644 --- a/components/data/TVEpisodeData.bs +++ b/components/data/TVEpisodeData.bs @@ -13,7 +13,7 @@ sub setFields() end sub sub setPoster() - if m.top.image <> invalid + if isValid(m.top.image) m.top.posterURL = m.top.image.url else m.top.posterURL = ""