diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-03-26 04:46:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-03-26 07:32:40 +0300 |
commit | a8e749f624a847149658d763cf1168dfd4fc2f7f (patch) | |
tree | 14c3c2a0d5dd8dcb691380d5aa47cb642688484a /source/blender | |
parent | ffd26b420ce991c983c68d6c2b00459aefd6c012 (diff) |
Fix crash setting the brush with the current brush was unset
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_ops.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 59a0c50d402..0ed657ba460 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -716,7 +716,8 @@ static bool brush_generic_tool_set(bContext *C, brush = brush_tool_cycle(bmain, paint, brush_orig, tool); } - if (!brush && brush_tool(brush_orig, paint->runtime.tool_offset) != tool && create_missing) { + if (((brush == NULL) && create_missing) && + ((brush_orig == NULL) || brush_tool(brush_orig, paint->runtime.tool_offset) != tool)) { brush = BKE_brush_add(bmain, tool_name, paint->runtime.ob_mode); id_us_min(&brush->id); /* fake user only */ brush_tool_set(brush, paint->runtime.tool_offset, tool); |