From 83d3ae658deb1cb98ebf40d3bb16b32d89257ae1 Mon Sep 17 00:00:00 2001 From: Joseph Battelle Date: Wed, 3 Feb 2021 17:09:24 -0800 Subject: [PATCH] Fix for Workspace Explorer panel with no workspace Don't give focus to a non-existent child. Previously any hide/show of the Workspace Explorer without a workspace loaded would crash. --- IDE/src/ui/ProjectPanel.bf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/IDE/src/ui/ProjectPanel.bf b/IDE/src/ui/ProjectPanel.bf index ef594582..1a963d03 100644 --- a/IDE/src/ui/ProjectPanel.bf +++ b/IDE/src/ui/ProjectPanel.bf @@ -181,9 +181,10 @@ namespace IDE.ui { base.FocusForKeyboard(); SetFocus(); - if (mListView.GetRoot().FindFocusedItem() == null) + let root = mListView.GetRoot(); + if (root.IsOpen && root.FindFocusedItem() == null) { - mListView.GetRoot().GetChildAtIndex(0).Focused = true; + root.GetChildAtIndex(0).Focused = true; } }