From d1b142db08b3a79454f984ded35ab764d9969b8f Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sat, 15 May 2021 16:34:38 +0200 Subject: [PATCH] Fix error in context menu search on fail --- Source/Editor/GUI/ContextMenu/ContextMenu.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Editor/GUI/ContextMenu/ContextMenu.cs b/Source/Editor/GUI/ContextMenu/ContextMenu.cs index 04dded53c..966f3502b 100644 --- a/Source/Editor/GUI/ContextMenu/ContextMenu.cs +++ b/Source/Editor/GUI/ContextMenu/ContextMenu.cs @@ -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();