From 7dbf7255c2c0d80cd5baf341232fe103185e64a8 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Sat, 28 Mar 2020 12:33:32 +0100 Subject: GPencil: Fix error when stroke has 0 points It's possible create a stroke with 0 points using python --- source/blender/blenkernel/intern/gpencil.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/blenkernel/intern/gpencil.c') diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 555b0af5a63..fc7f15348bc 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1926,6 +1926,9 @@ void BKE_gpencil_visible_stroke_iter( } LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { + if (gps->totpoints == 0) { + continue; + } stroke_cb(gpl, gpf, gps, thunk); } } @@ -1939,6 +1942,9 @@ void BKE_gpencil_visible_stroke_iter( } LISTBASE_FOREACH (bGPDstroke *, gps, &act_gpf->strokes) { + if (gps->totpoints == 0) { + continue; + } stroke_cb(gpl, act_gpf, gps, thunk); } } -- cgit v1.2.3