Commit: 545f3f1728361b31197b9d0397fcefd242d1fdad
Author: Antonioya
Date:   Thu Dec 20 17:14:03 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB545f3f1728361b31197b9d0397fcefd242d1fdad

Fix T59648: Linking material to greasepencil object causes crash

===================================================================

M       source/blender/draw/engines/gpencil/gpencil_draw_utils.c

===================================================================

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) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to