diff options
author | Jacques Lucke <jacques@blender.org> | 2022-05-05 13:51:14 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-05-05 13:52:19 +0300 |
commit | bff9bf728e1623ac01ef0230d86832592796b6d3 (patch) | |
tree | 95f5ce5a063faf428ee7dc7856fbde5a505a107f | |
parent | 611b82621d5739deddefe697d7a407cff9b6d919 (diff) |
Fix T97774: don't crash when no brush is selected
-rw-r--r-- | source/blender/editors/sculpt_paint/curves_sculpt_ops.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc b/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc index d773b4e70a7..d8713c8eb1d 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc @@ -149,6 +149,12 @@ static void stroke_done(const bContext *C, PaintStroke *stroke) static int sculpt_curves_stroke_invoke(bContext *C, wmOperator *op, const wmEvent *event) { + Paint *paint = BKE_paint_get_active_from_context(C); + Brush *brush = BKE_paint_brush(paint); + if (brush == nullptr) { + return OPERATOR_CANCELLED; + } + SculptCurvesBrushStrokeData *op_data = MEM_new<SculptCurvesBrushStrokeData>(__func__); op_data->stroke = paint_stroke_new(C, op, |