1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-05 17:15:09 +00:00

[Modules] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable

This commit is contained in:
A Thousand Ships
2023-09-09 17:40:07 +02:00
parent 36945dad07
commit 517e9f8aef
44 changed files with 557 additions and 557 deletions

View File

@@ -268,7 +268,7 @@ void MultiplayerSpawner::_spawn_notify(ObjectID p_id) {
void MultiplayerSpawner::_node_exit(ObjectID p_id) {
Node *node = Object::cast_to<Node>(ObjectDB::get_instance(p_id));
ERR_FAIL_COND(!node);
ERR_FAIL_NULL(node);
if (tracked_nodes.has(p_id)) {
tracked_nodes.erase(p_id);
get_multiplayer()->object_configuration_remove(node, this);
@@ -323,10 +323,10 @@ Node *MultiplayerSpawner::spawn(const Variant &p_data) {
ERR_FAIL_COND_V_MSG(!spawn_function.is_valid(), nullptr, "Custom spawn requires the 'spawn_function' property to be a valid callable.");
Node *parent = get_spawn_node();
ERR_FAIL_COND_V_MSG(!parent, nullptr, "Cannot find spawn node.");
ERR_FAIL_NULL_V_MSG(parent, nullptr, "Cannot find spawn node.");
Node *node = instantiate_custom(p_data);
ERR_FAIL_COND_V_MSG(!node, nullptr, "The 'spawn_function' callable must return a valid node.");
ERR_FAIL_NULL_V_MSG(node, nullptr, "The 'spawn_function' callable must return a valid node.");
_track(node, p_data);
parent->add_child(node, true);