Skip to content

Commit

Permalink
GH-567 Correctly validate local variable node connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Jul 22, 2024
1 parent 6647c3a commit 5f9f3f4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/script/nodes/variables/local_variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,12 @@ void OScriptNodeAssignLocalVariable::validate_node_during_build(BuildLog& p_log)
p_log.error(this, variable, "Requires a connection.");
else
{
Ref<OScriptNodeLocalVariable> local_variable = variable->get_connections()[0];
if (!local_variable.is_valid())
p_log.error(this, variable, "Connection expected with a Local Variable node.");
Ref<OScriptNodePin> source_pin = variable->get_connections()[0];
if (source_pin.is_valid())
{
if (!Object::cast_to<OScriptNodeLocalVariable>(source_pin->get_owning_node()))
p_log.error(this, variable, "Connection expected with a Local Variable node.");
}
}
}
}
Expand Down

0 comments on commit 5f9f3f4

Please sign in to comment.