Browse Source

mListView empty check

Brian Fiete 1 year ago
parent
commit
af9f6a5cba
1 changed files with 8 additions and 5 deletions
  1. 8 5
      IDE/src/ui/WatchPanel.bf

+ 8 - 5
IDE/src/ui/WatchPanel.bf

@@ -3246,12 +3246,15 @@ namespace IDE.ui
 
 			bool hasVisibleItem = false;
 			bool hasHiddemItems = false;
-			for (var item in mListView.GetRoot().mChildItems)
+			if (mListView.GetRoot().GetChildCount() > 0)
 			{
-				if (item.mSelfHeight > 0)
-					hasVisibleItem = true;
-				else
-					hasHiddemItems = true;
+				for (var item in mListView.GetRoot().mChildItems)
+				{
+					if (item.mSelfHeight > 0)
+						hasVisibleItem = true;
+					else
+						hasHiddemItems = true;
+				}
 			}
 
 			if ((hasHiddemItems) && (!hasVisibleItem))