diff --git a/source/blender/editors/interface/interface_handlers.cc b/source/blender/editors/interface/interface_handlers.cc index bd1e485d917..45012a3e789 100644 --- a/source/blender/editors/interface/interface_handlers.cc +++ b/source/blender/editors/interface/interface_handlers.cc @@ -6503,7 +6503,10 @@ static int ui_do_but_COLOR(bContext *C, uiBut *but, uiHandleButtonData *data, co if (paint != nullptr) { Brush *brush = BKE_paint_brush(paint); - if (brush->flag & BRUSH_USE_GRADIENT) { + if (brush == nullptr) { + /* Pass. */ + } + else if (brush->flag & BRUSH_USE_GRADIENT) { float *target = &brush->gradient->data[brush->gradient->cur].r; if (but->rnaprop && RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA) {