From bff9bf728e1623ac01ef0230d86832592796b6d3 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 5 May 2022 12:51:14 +0200 Subject: Fix T97774: don't crash when no brush is selected --- source/blender/editors/sculpt_paint/curves_sculpt_ops.cc | 6 ++++++ 1 file changed, 6 insertions(+) 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(__func__); op_data->stroke = paint_stroke_new(C, op, -- cgit v1.2.3