Grease pencil, floating panel, "Delete last stroke" crashed when there 
were no strokes. Simple NULL check added.
This commit is contained in:
Ton Roosendaal 2009-04-29 16:16:08 +00:00
parent f56bfbdd0c
commit 133c91dd2f

@ -139,12 +139,14 @@ void gp_ui_delstroke_cb (void *gpd, void *gpl)
{
bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0);
if (gpf->framenum != CFRA) return;
if (gpf) {
if (gpf->framenum != CFRA) return;
gpencil_layer_setactive(gpd, gpl);
gpencil_frame_delete_laststroke(gpl, gpf);
scrarea_queue_winredraw(curarea);
gpencil_layer_setactive(gpd, gpl);
gpencil_frame_delete_laststroke(gpl, gpf);
scrarea_queue_winredraw(curarea);
}
}
/* delete active frame of active layer */