Fix T73121: Blender crashes on accessing particle uv_on_emitter

Blender wasn't checking whether the passed modifier actually contained an
evaluated mesh, before accessing the mesh pointer.
This commit is contained in:
Sybren A. Stüvel
2020-01-16 14:52:01 +01:00
parent 9a6551543b
commit 3c426feb12

View File

@@ -286,6 +286,11 @@ static void rna_Particle_uv_on_emitter(ParticleData *particle,
psmd, part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co, nor, 0, 0, sd.orco, 0);
# endif
if (modifier->mesh_final == NULL) {
BKE_report(reports, RPT_ERROR, "uv_on_emitter() requires a modifier from an evaluated object");
return;
}
/* get uvco & mcol */
int num = particle->num_dmcache;
int from = modifier->psys->part->from;