Fix T103307: Crash reading particle hair key.co

05952aa94d accessed the vertex array when the mesh was null.
This commit is contained in:
Hans Goudey 2022-12-19 13:05:05 -06:00
parent 81f425a36f
commit 9f575ece39
Notes: blender-bot 2023-02-14 12:01:57 +01:00
Referenced by issue #103307, Regression: Crash when trying to read particle hair_key.co.
1 changed files with 1 additions and 1 deletions

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);
}