Selaa lähdekoodia

Avoid crash in scene importer when the mesh is empty.

K. S. Ernest (iFire) Lee 3 vuotta sitten
vanhempi
commit
d905d3c3d3
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      editor/import/resource_importer_scene.cpp

+ 1 - 0
editor/import/resource_importer_scene.cpp

@@ -342,6 +342,7 @@ static String _fixstr(const String &p_what, const String &p_str) {
 
 
 static void _pre_gen_shape_list(Ref<ImporterMesh> &mesh, Vector<Ref<Shape3D>> &r_shape_list, bool p_convex) {
 static void _pre_gen_shape_list(Ref<ImporterMesh> &mesh, Vector<Ref<Shape3D>> &r_shape_list, bool p_convex) {
 	ERR_FAIL_NULL_MSG(mesh, "Cannot generate shape list with null mesh value");
 	ERR_FAIL_NULL_MSG(mesh, "Cannot generate shape list with null mesh value");
+	ERR_FAIL_NULL_MSG(mesh->get_mesh(), "Cannot generate shape list with null mesh value");
 	if (!p_convex) {
 	if (!p_convex) {
 		Ref<Shape3D> shape = mesh->create_trimesh_shape();
 		Ref<Shape3D> shape = mesh->create_trimesh_shape();
 		r_shape_list.push_back(shape);
 		r_shape_list.push_back(shape);