Merge pull request #330 from aws-lumberyard-dev/LYN2903_ScriptCanvasDeleteComponentVariableCrash

Null check when removing old component variables.
This commit is contained in:
Gene Walters
2021-04-27 10:12:10 -07:00
committed by GitHub
@@ -528,8 +528,10 @@ namespace ScriptCanvasEditor
{
const auto& variableId = varConfig.m_graphVariable.GetVariableId();
// We only add component sourced graph properties to the script canvas component, so if this variable was switched to a graph-only property remove it.
// Also be sure to remove this variable if it's been deleted entirely.
auto graphVariable = graphVarData.FindVariable(variableId);
if (!graphVariable->IsComponentProperty())
if (!graphVariable || !graphVariable->IsComponentProperty())
{
oldVariableIds.push_back(variableId);
}