Skip to content

Commit

Permalink
Merge pull request #79655 from kleonc/scene-dubugger-remove-outdated-…
Browse files Browse the repository at this point in the history
…error-check

Fix arg count checks in `SceneDebugger`
  • Loading branch information
YuriSizov committed Jul 21, 2023
2 parents 7a31331 + 95809e5 commit 4770e87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scene/debugger/scene_debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ Error SceneDebugger::parse_message(void *p_user, const String &p_msg, const Arra
live_editor->_res_set_func(p_args[0], p_args[1], p_args[2]);

} else if (p_msg == "live_node_call") {
ERR_FAIL_COND_V(p_args.size() < 2, ERR_INVALID_DATA);
LocalVector<Variant> args;
LocalVector<Variant *> argptrs;
args.resize(p_args.size() - 2);
Expand All @@ -171,11 +172,10 @@ Error SceneDebugger::parse_message(void *p_user, const String &p_msg, const Arra
args[i] = p_args[i + 2];
argptrs[i] = &args[i];
}
live_editor->_node_call_func(p_args[0], p_args[1], (const Variant **)argptrs.ptr(), argptrs.size());
live_editor->_node_call_func(p_args[0], p_args[1], argptrs.size() ? (const Variant **)argptrs.ptr() : nullptr, argptrs.size());

} else if (p_msg == "live_res_call") {
ERR_FAIL_COND_V(p_args.size() < 10, ERR_INVALID_DATA);

ERR_FAIL_COND_V(p_args.size() < 2, ERR_INVALID_DATA);
LocalVector<Variant> args;
LocalVector<Variant *> argptrs;
args.resize(p_args.size() - 2);
Expand All @@ -184,7 +184,7 @@ Error SceneDebugger::parse_message(void *p_user, const String &p_msg, const Arra
args[i] = p_args[i + 2];
argptrs[i] = &args[i];
}
live_editor->_res_call_func(p_args[0], p_args[1], (const Variant **)argptrs.ptr(), argptrs.size());
live_editor->_res_call_func(p_args[0], p_args[1], argptrs.size() ? (const Variant **)argptrs.ptr() : nullptr, argptrs.size());

} else if (p_msg == "live_create_node") {
ERR_FAIL_COND_V(p_args.size() < 3, ERR_INVALID_DATA);
Expand Down

0 comments on commit 4770e87

Please sign in to comment.