fix out of range error when searching visject cm

This commit is contained in:
xxSeys1
2025-06-14 01:04:35 +02:00
parent baba151d8a
commit 2e0c35e6e4
2 changed files with 2 additions and 2 deletions

View File

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

View File

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