Merge pull request #83764 from timothyqiu/suffix-only

Fix infinite loop when importing 3D object named "-colonly"
This commit is contained in:
Rémi Verschelde 2023-10-26 16:00:08 +02:00
commit 4f138db264
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -669,7 +669,11 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, HashMap<R
fixed_name = _fixstr(name, "convcolonly"); fixed_name = _fixstr(name, "convcolonly");
} }
ERR_FAIL_COND_V(fixed_name.is_empty(), nullptr); if (fixed_name.is_empty()) {
p_node->set_owner(nullptr);
memdelete(p_node);
ERR_FAIL_V_MSG(nullptr, vformat("Skipped node `%s` because its name is empty after removing the suffix.", name));
}
ImporterMeshInstance3D *mi = Object::cast_to<ImporterMeshInstance3D>(p_node); ImporterMeshInstance3D *mi = Object::cast_to<ImporterMeshInstance3D>(p_node);
if (mi) { if (mi) {