Ver código fonte

add null check in MeshInstance::_mesh_changed()

Angad Kambli 4 anos atrás
pai
commit
6b602d35f3
1 arquivos alterados com 1 adições e 0 exclusões
  1. 1 0
      scene/3d/mesh_instance_3d.cpp

+ 1 - 0
scene/3d/mesh_instance_3d.cpp

@@ -319,6 +319,7 @@ Ref<Material> MeshInstance3D::get_active_material(int p_surface) const {
 }
 }
 
 
 void MeshInstance3D::_mesh_changed() {
 void MeshInstance3D::_mesh_changed() {
+	ERR_FAIL_COND(mesh.is_null());
 	materials.resize(mesh->get_surface_count());
 	materials.resize(mesh->get_surface_count());
 }
 }