diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-23 20:31:55 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-23 20:32:08 +0300 |
commit | d12f0d3f70322ef01eef6e8ec72f7fbaf5a191ba (patch) | |
tree | 2d7695f20dace4b8c44a357b946ee12b61091aa6 /source/blender | |
parent | 392855ce5022ccfeaa52efc04b13a7208ed0dc3f (diff) |
Fix: Crash with empty vertex group in mask modifier
The C++ vertex group data accessor returned a span with null data that
wasn't empty. Instead of adding a null check as well as the size check,
just return an empty span when there is no vertex group data.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_mesh.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index c1f4d9733aa..de89abf9cf6 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -1139,7 +1139,11 @@ inline blender::MutableSpan<MLoop> Mesh::loops_for_write() inline blender::Span<MDeformVert> Mesh::deform_verts() const { - return {BKE_mesh_deform_verts(this), this->totvert}; + const MDeformVert *dverts = BKE_mesh_deform_verts(this); + if (!dverts) { + return {}; + } + return {dverts, this->totvert}; } inline blender::MutableSpan<MDeformVert> Mesh::deform_verts_for_write() { |