From 2e0c35e6e4eca5c0770aa1623f997f9b5e16888f Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Sat, 14 Jun 2025 01:04:35 +0200 Subject: [PATCH] fix out of range error when searching visject cm --- Source/Editor/Surface/ContextMenu/VisjectCM.cs | 2 +- Source/Editor/Surface/VisjectSurface.Draw.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Editor/Surface/ContextMenu/VisjectCM.cs b/Source/Editor/Surface/ContextMenu/VisjectCM.cs index de9261356..42c863789 100644 --- a/Source/Editor/Surface/ContextMenu/VisjectCM.cs +++ b/Source/Editor/Surface/ContextMenu/VisjectCM.cs @@ -594,7 +594,7 @@ namespace FlaxEditor.Surface.ContextMenu // Update groups LockChildrenRecursive(); - var contextSensitiveSelectedBox = _contextSensitiveSearchEnabled ? _selectedBoxes[0] : null; + var contextSensitiveSelectedBox = _contextSensitiveSearchEnabled && _selectedBoxes.Count > 0 ? _selectedBoxes[0] : null; for (int i = 0; i < _groups.Count; i++) { _groups[i].UpdateFilter(_searchBox.Text, contextSensitiveSelectedBox); diff --git a/Source/Editor/Surface/VisjectSurface.Draw.cs b/Source/Editor/Surface/VisjectSurface.Draw.cs index 5f8a7284a..b413ae032 100644 --- a/Source/Editor/Surface/VisjectSurface.Draw.cs +++ b/Source/Editor/Surface/VisjectSurface.Draw.cs @@ -137,7 +137,7 @@ namespace FlaxEditor.Surface IConnectionInstigator currentInstigator = instigators[i]; Float2 currentStartPosition = currentInstigator.ConnectionOrigin; - // Check if mouse is over any of box + // Check if mouse is over any box if (_lastInstigatorUnderMouse != null && !cmVisible) { // Check if can connect objects