Skip to content

Commit 6ff0616

Browse files
committed
Merge pull request #107375 from suhankins/master
Add a proper error message when trying to add node to a group with an empty name
2 parents 0129180 + 6e65016 commit 6ff0616

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scene/main/node.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2391,7 +2391,7 @@ bool Node::is_in_group(const StringName &p_identifier) const {
23912391

23922392
void Node::add_to_group(const StringName &p_identifier, bool p_persistent) {
23932393
ERR_THREAD_GUARD
2394-
ERR_FAIL_COND(!p_identifier.operator String().length());
2394+
ERR_FAIL_COND_MSG(p_identifier.is_empty(), vformat("Cannot add node '%s' to a group with an empty name.", get_name()));
23952395

23962396
if (data.grouped.has(p_identifier)) {
23972397
return;

0 commit comments

Comments
 (0)