Fix crash with missing NULL check accessing grease pencil paint

This commit is contained in:
Campbell Barton 2020-03-26 15:10:58 +11:00
parent a9394aa48e
commit e990e55eba
1 changed files with 3 additions and 0 deletions

View File

@ -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);