Draw: Fix crash when tryign to get procedural textures with modifier disabled
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 7 Jun 2018 14:38:52 +0000 (16:38 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 7 Jun 2018 14:40:15 +0000 (16:40 +0200)
Maybe disabled modifier check should be done higher in the call hierarchy.

source/blender/draw/intern/draw_cache_impl_particles.c

index 1348968..4646913 100644 (file)
@@ -779,7 +779,7 @@ static void particle_batch_cache_ensure_procedural_strand_data(
 
        ParticleSystemModifierData *psmd = (ParticleSystemModifierData *)md;
 
-       if (psmd != NULL) {
+       if (psmd != NULL && psmd->mesh_final != NULL) {
                if (CustomData_has_layer(&psmd->mesh_final->ldata, CD_MLOOPUV)) {
                        cache->num_uv_layers = CustomData_number_of_layers(&psmd->mesh_final->ldata, CD_MLOOPUV);
                        active_uv = CustomData_get_active_layer(&psmd->mesh_final->ldata, CD_MLOOPUV);