Fix error in context menu search on fail

This commit is contained in:
Wojtek Figat
2021-05-15 16:34:38 +02:00
parent c32add161b
commit d1b142db08

View File

@@ -439,7 +439,7 @@ namespace FlaxEditor.GUI.ContextMenu
}
}
}
if (startIndex != -1)
if (startIndex > 0 && startIndex <= _panel.Children.Count)
{
// No more items found so start from the top if there are matching items
_panel.Children[startIndex - 1].Defocus();