diff options
author | Antonioya <blendergit@gmail.com> | 2018-12-20 19:14:03 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-12-20 19:14:03 +0300 |
commit | 545f3f1728361b31197b9d0397fcefd242d1fdad (patch) | |
tree | 19b665b05413bdcc5ddbd0752f29f8ae8006385f /source | |
parent | 36121a1bdcd8b0122996d9125e0cd4972dd51ff0 (diff) |
Fix T59648: Linking material to greasepencil object causes crash
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_draw_utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index a6ef5d6a45a..8b655854ca1 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -1374,6 +1374,11 @@ static void DRW_gpencil_shgroups_create( bGPDframe *gpf = elm->gpf; bGPDstroke *gps = elm->gps; MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1); + /* if the user switch used material from data to object, + * the material could not be available */ + if (gp_style == NULL) { + break; + } /* limit the number of shading groups */ if (i >= GPENCIL_MAX_SHGROUPS) { |