Merge pull request #51190 from timothyqiu/vs-node

Validates VisualScript.add_node input node
This commit is contained in:
Rémi Verschelde 2021-08-02 18:18:19 +02:00 committed by GitHub
commit cbfe6a4180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,6 +271,7 @@ void VisualScript::_node_ports_changed(int p_id) {
void VisualScript::add_node(int p_id, const Ref<VisualScriptNode> &p_node, const Point2 &p_pos) {
ERR_FAIL_COND(instances.size());
ERR_FAIL_COND(nodes.has(p_id)); // ID can exist only one in script.
ERR_FAIL_COND(p_node.is_null());
NodeData nd;
nd.node = p_node;