fix [#31427] Crash when undoing until no point in grease pencil poly mode

This commit is contained in:
Campbell Barton 2012-05-12 21:23:02 +00:00
parent 7413ab8f1f
commit 613f464c51

@ -322,6 +322,11 @@ static short gp_stroke_addpoint(tGPsdata *p, const int mval[2], float pressure)
bGPdata *gpd = p->gpd;
tGPspoint *pt;
/* sanity check, can happen after undo [#31427] */
if (p->flags & GP_PAINTFLAG_STROKEADDED && p->gpf->strokes.last == NULL) {
p->flags &= ~GP_PAINTFLAG_STROKEADDED;
}
/* check painting mode */
if (p->paintmode == GP_PAINTMODE_DRAW_STRAIGHT) {
/* straight lines only - i.e. only store start and end point in buffer */