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.
This commit is contained in:
Hans Goudey 2022-09-23 12:31:55 -05:00
parent 392855ce50
commit d12f0d3f70
1 changed files with 5 additions and 1 deletions

View File

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