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();