1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

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.
This commit is contained in:
Joseph Battelle 2021-02-03 17:09:24 -08:00
parent 3f68473fe1
commit 83d3ae658d

View file

@ -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;
}
}