diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-03-26 07:10:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-03-26 07:32:40 +0300 |
commit | e990e55eba2aa8734cb328065b1731dc83e39187 (patch) | |
tree | 89cf5c526df6e470df5501fd78da4702b3d12a60 /source/blender/editors/sculpt_paint/paint_ops.c | |
parent | a9394aa48e36daf08402a5781258977f66414ba0 (diff) |
Fix crash with missing NULL check accessing grease pencil paint
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_ops.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_ops.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index ff0852aaf16..cc848b80bb3 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -779,6 +779,9 @@ static int brush_select_exec(bContext *C, wmOperator *op) } Paint *paint = BKE_paint_get_active_from_paintmode(scene, paint_mode); + if (paint == NULL) { + return OPERATOR_CANCELLED; + } const EnumPropertyItem *items = BKE_paint_get_tool_enum_from_paintmode(paint_mode); RNA_enum_name_from_value(items, tool, &tool_name); |