Fix crash when trying to read invalid Visual Script parameter from local scope during debugging

This commit is contained in:
Wojtek Figat
2022-01-07 12:25:16 +01:00
parent bbfe0446f0
commit e144a6f69d

View File

@@ -624,7 +624,9 @@ void VisualScriptExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value&
{
// Evaluate method parameter value from the current scope
auto& scope = ThreadStacks.Get().Stack->Scope;
value = scope->Parameters[boxBase->ID - 1];
int32 index = boxBase->ID - 1;
if (index < scope->Parameters.Length())
value = scope->Parameters.Get()[index];
}
break;
}