Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2016-09-21 08:02:17 +0300
committerJoshua Leung <aligorith@gmail.com>2016-09-21 08:03:45 +0300
commit586c58902d9b1b1edc417728aa3e357c1e66d3a8 (patch)
tree96436bb45282052200d96101dbd05b5a5a433f42 /source/blender/editors/gpencil/gpencil_edit.c
parent0b9cfbf6a8d1102aa00d926d649f5866fcb4c91f (diff)
Fix: Grease Pencil sculpting crashes when sculpting on layers without any strokes
Reported by @loochmunz. I've also gone through checking for and fixing other places where this was also occurring. To be included in 2.78
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_edit.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 7175ec3e83d..12d837dfb29 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -1504,6 +1504,9 @@ static int gp_stroke_cyclical_set_exec(bContext *C, wmOperator *op)
/* loop all selected strokes */
CTX_DATA_BEGIN(C, bGPDlayer *, gpl, editable_gpencil_layers)
{
+ if (gpl->actframe == NULL)
+ continue;
+
for (bGPDstroke *gps = gpl->actframe->strokes.last; gps; gps = gps->prev) {
bGPDpalettecolor *palcolor = gps->palcolor;
@@ -1724,6 +1727,9 @@ static int gp_stroke_join_exec(bContext *C, wmOperator *op)
CTX_DATA_BEGIN(C, bGPDlayer *, gpl, editable_gpencil_layers)
{
bGPDframe *gpf = gpl->actframe;
+ if (gpf == NULL)
+ continue;
+
for (gps = gpf->strokes.first; gps; gps = gpsn) {
gpsn = gps->next;
if (gps->flag & GP_STROKE_SELECT) {