Explorar o código

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

Haoyu Qiu hai 1 ano
pai
achega
c19bf7cda9
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      editor/import/resource_importer_scene.cpp

+ 5 - 1
editor/import/resource_importer_scene.cpp

@@ -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) {