From 6e650163da4f990cc27212391d5853f3eb630c65 Mon Sep 17 00:00:00 2001 From: Dimitri Sukhankin <90870844+suhankins@users.noreply.github.com> Date: Sat, 21 Jun 2025 00:11:31 +0400 Subject: [PATCH] Add a proper error message when trying to add node to a group with an empty name --- scene/main/node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 610a2c61cb..170b3680a4 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2391,7 +2391,7 @@ bool Node::is_in_group(const StringName &p_identifier) const { void Node::add_to_group(const StringName &p_identifier, bool p_persistent) { ERR_THREAD_GUARD - ERR_FAIL_COND(!p_identifier.operator String().length()); + ERR_FAIL_COND_MSG(p_identifier.is_empty(), vformat("Cannot add node '%s' to a group with an empty name.", get_name())); if (data.grouped.has(p_identifier)) { return;