Fix T103307: Crash reading particle hair key.co

05952aa94d accessed the vertex array when the mesh was null.
This commit is contained in:
2022-12-19 13:05:05 -06:00
parent 81f425a36f
commit 9f575ece39

View File

@@ -212,8 +212,8 @@ static void rna_ParticleHairKey_location_object_get(PointerRNA *ptr, float *valu
if (pa) {
Mesh *hair_mesh = (psmd->psys->flag & PSYS_HAIR_DYNAMICS) ? psmd->psys->hair_out_mesh : NULL;
const MVert *verts = BKE_mesh_verts(hair_mesh);
if (hair_mesh) {
const MVert *verts = BKE_mesh_verts(hair_mesh);
const MVert *mv = &verts[pa->hair_index + (hkey - pa->hair)];
copy_v3_v3(values, mv->co);
}