Fix infinite loop when importing 3D object named "-colonly"

This commit is contained in:
Haoyu Qiu 2023-10-22 11:31:28 +08:00
parent f71f4b80e3
commit c19bf7cda9

View file

@ -669,7 +669,11 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, HashMap<R
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);
if (mi) {