From da702bc8c00b6c48b8fbd0d178b40066b42170e7 Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Wed, 31 Jul 2024 08:54:20 -0400 Subject: [PATCH] validate node ref to prevent crash --- components/ItemGrid/ItemGridOptions.bs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/ItemGrid/ItemGridOptions.bs b/components/ItemGrid/ItemGridOptions.bs index 7d43137da..7a10e11dd 100644 --- a/components/ItemGrid/ItemGridOptions.bs +++ b/components/ItemGrid/ItemGridOptions.bs @@ -195,6 +195,8 @@ sub buttonFocusChanged() end sub sub toggleFavorite() + if not isValid(m.selectedFavoriteItem) then return + m.favItemsTask = createObject("roSGNode", "FavoriteItemsTask") if m.favoriteMenu.iconUri = "pkg:/images/icons/favorite.png" m.favoriteMenu.iconUri = "pkg:/images/icons/favorite_selected.png"