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:
authorAntonio Vazquez <blendergit@gmail.com>2019-08-01 18:05:53 +0300
committerAntonio Vazquez <blendergit@gmail.com>2019-08-01 18:05:53 +0300
commit03bbd5f9dedf7b3dfea7119c172c61f0b50ae28c (patch)
tree79ab34e79af6a700c6f73f331e4ee4e253ab3751 /source/blender/editors/gpencil/gpencil_ops.c
parent2204bfcf9e1c3a38e60830bd97775dd72158f4d6 (diff)
parent49b2162309da6abf66764d41d9fc4c45ad01936c (diff)
Merge branch 'master' into temp-gpencil-drw-engine
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_ops.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_ops.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c
index db4c601709c..d259bb9183c 100644
--- a/source/blender/editors/gpencil/gpencil_ops.c
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@ -81,9 +81,15 @@ static bool gp_stroke_paintmode_poll_with_tool(bContext *C, const char gpencil_t
{
/* TODO: limit this to mode, but review 2D editors */
bGPdata *gpd = CTX_data_gpencil_data(C);
+ if (!gpd)
+ return false;
+
ToolSettings *ts = CTX_data_tool_settings(C);
+ if (!ts || !ts->gp_paint)
+ return false;
+
Brush *brush = BKE_paint_brush(&ts->gp_paint->paint);
- return ((gpd) && (gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush && brush->gpencil_settings) &&
+ return ((gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush && brush->gpencil_settings) &&
WM_toolsystem_active_tool_is_brush(C) && (brush->gpencil_tool == gpencil_tool));
}