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:
parent
392855ce50
commit
d12f0d3f70
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue