Merge pull request #2304 from aws-lumberyard-dev/scripting/contract_crash_fix
Crash guard when the data has a list with an empty contract
This commit is contained in:
@@ -23,6 +23,11 @@ namespace ScriptCanvas
|
||||
AZStd::string failedContract;
|
||||
AZStd::all_of(firstSlot.GetContracts().begin(), firstSlot.GetContracts().end(), [&firstSlot, &secondSlot, &outcome](const AZStd::unique_ptr<Contract>& contract)
|
||||
{
|
||||
if (!contract)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
outcome = contract->Evaluate(firstSlot, secondSlot);
|
||||
if (outcome.IsSuccess())
|
||||
{
|
||||
|
||||
@@ -828,10 +828,13 @@ namespace ScriptCanvas
|
||||
|
||||
for (const auto& contract : m_contracts)
|
||||
{
|
||||
failureReason = contract->EvaluateForType(dataType);
|
||||
if (!failureReason)
|
||||
if (contract)
|
||||
{
|
||||
return failureReason;
|
||||
failureReason = contract->EvaluateForType(dataType);
|
||||
if (!failureReason)
|
||||
{
|
||||
return failureReason;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user