diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp index 7b3a0820f12..b997c64b295 100644 --- a/scene/3d/mesh_instance_3d.cpp +++ b/scene/3d/mesh_instance_3d.cpp @@ -319,6 +319,7 @@ Ref MeshInstance3D::get_active_material(int p_surface) const { } void MeshInstance3D::_mesh_changed() { + ERR_FAIL_COND(mesh.is_null()); materials.resize(mesh->get_surface_count()); }