From ebf2e4e1af250cfd74ca7a30bd9f8d36d3054203 Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Thu, 20 Apr 2023 12:01:52 -0400 Subject: [PATCH] Ensure vars are valid before using - fixes 1.6.4 crash log line 56 --- components/ItemGrid/ItemGridOptions.brs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/components/ItemGrid/ItemGridOptions.brs b/components/ItemGrid/ItemGridOptions.brs index d0d5a8c1..61281adc 100644 --- a/components/ItemGrid/ItemGridOptions.brs +++ b/components/ItemGrid/ItemGridOptions.brs @@ -53,6 +53,11 @@ sub hideChecklist() end sub sub onFilterFocusChange() + if isFilterMenuDataValid() = false + hideChecklist() + return + end if + if m.filterMenu.content.getChild(m.filterMenu.itemFocused).getChildCount() > 0 showChecklist() else @@ -67,6 +72,18 @@ sub onFilterFocusChange() end if end sub +' Ensure all data for Filter Menu is valid +function isFilterMenuDataValid() as boolean + if not isValid(m.filterMenu) or not isValid(m.filterMenu.content) or not isValid(m.filterMenu.itemFocused) + return false + end if + + if not isValid(m.filterMenu.content.getChild(m.filterMenu.itemFocused)) + return false + end if + + return true +end function sub optionsSet() ' Views Tab