[Bf-blender-cvs] [19d73bd6b20] lanpr-under-gp: LineArt: Null handling when gpencil target is an empty object.

YimingWu noreply at git.blender.org
Tue Jul 7 17:07:40 CEST 2020


Commit: 19d73bd6b200c4dbe7912f27f0da2bdd64e39326
Author: YimingWu
Date:   Tue Jul 7 23:06:30 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rB19d73bd6b200c4dbe7912f27f0da2bdd64e39326

LineArt: Null handling when gpencil target is an empty object.

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

M	source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c

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

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index e08228e1227..dec96d3311e 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -141,6 +141,9 @@ static void generateStrokes(GpencilModifierData *md, Depsgraph *depsgraph, Objec
    * done by calculation function.*/
 
   bGPDlayer *gpl = BKE_gpencil_layer_get_by_name(gpd, lmd->target_layer, 1);
+  if (gpl == NULL) {
+    return;
+  }
   bGPDframe *gpf = gpl->actframe;
   if (gpf == NULL) {
     return;
@@ -161,6 +164,9 @@ static void bakeModifier(Main *UNUSED(bmain),
   LineartGpencilModifierData *lmd = (LineartGpencilModifierData *)md;
 
   bGPDlayer *gpl = BKE_gpencil_layer_get_by_name(gpd, lmd->target_layer, 1);
+  if (gpl == NULL) {
+    return;
+  }
   bGPDframe *gpf = gpl->actframe;
   if (gpf == NULL) {
     return;



More information about the Bf-blender-cvs mailing list