diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-03-28 14:33:32 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-03-28 14:33:32 +0300 |
commit | 7dbf7255c2c0d80cd5baf341232fe103185e64a8 (patch) | |
tree | f99346f3ab61cd32beeeeb5fe6831e8dccf1d75a /source/blender/blenkernel/intern/gpencil.c | |
parent | bdec24b40d69e875f63657716becc5dd573536f3 (diff) |
GPencil: Fix error when stroke has 0 points
It's possible create a stroke with 0 points using python
Diffstat (limited to 'source/blender/blenkernel/intern/gpencil.c')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil.c | 6 |
1 files changed, 6 insertions, 0 deletions
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); } } |