From 05006b35d4a30f604525f121fa502f1adb987756 Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Wed, 31 Jul 2024 08:38:52 -0400 Subject: [PATCH] validate node ref to prevent crash --- components/ItemGrid/ItemGrid.bs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/components/ItemGrid/ItemGrid.bs b/components/ItemGrid/ItemGrid.bs index 654b232a6..55c5f7b36 100644 --- a/components/ItemGrid/ItemGrid.bs +++ b/components/ItemGrid/ItemGrid.bs @@ -70,13 +70,11 @@ sub init() m.resetGrid = m.global.session.user.settings["itemgrid.reset"] end sub -' 'Genre Item Selected sub onGenreItemSelected() m.top.selectedItem = m.genreList.content.getChild(m.genreList.rowItemSelected[0]).getChild(m.genreList.rowItemSelected[1]) end sub -' 'Load initial set of Data sub loadInitialItems() m.loadItemsTask.control = "stop" @@ -436,7 +434,6 @@ sub SetUpOptions() m.options.options = options end sub -' 'Handle loaded data, and add to Grid sub ItemDataLoaded(msg) itemData = msg.GetData() @@ -497,7 +494,6 @@ sub ItemDataLoaded(msg) stopLoadingSpinner() end sub -' 'Set Background Image sub SetBackground(backgroundUri as string) @@ -510,7 +506,6 @@ sub SetBackground(backgroundUri as string) m.newBackdrop.uri = backgroundUri end sub -' 'Handle new item being focused sub onItemFocused() @@ -536,7 +531,6 @@ sub onItemFocused() end if end sub -' 'When Image Loading Status changes sub newBGLoaded() 'If image load was sucessful, start the fade swap @@ -545,12 +539,9 @@ sub newBGLoaded() end if end sub -' 'Swap Complete sub swapDone() - - if m.swapAnimation.state = "stopped" - + if isValid(m.swapAnimation) and m.swapAnimation.state = "stopped" 'Set main BG node image and hide transitioning node m.backdrop.uri = m.newBackdrop.uri m.backdrop.opacity = 0.25 @@ -564,7 +555,6 @@ sub swapDone() end if end sub -' 'Load next set of items sub loadMoreData() if m.Loading = true then return @@ -576,7 +566,6 @@ sub loadMoreData() m.loadItemsTask.control = "RUN" end sub -' 'Item Selected sub onItemSelected() m.top.selectedItem = m.itemGrid.content.getChild(m.itemGrid.itemSelected) @@ -627,8 +616,6 @@ sub onvoiceFilter() end if end sub - -' 'Check if options updated and any reloading required sub optionsClosed() if m.top.parentItem.collectionType = "livetv" and m.options.view <> m.view