Fix T56457: Crash when selecting Grease Pencil objects
Thanks to Charlie Jolly (@charlie) for the backtrace
This commit is contained in:
@@ -129,7 +129,8 @@ static bool gp_stroke_paintmode_draw_poll(bContext *C)
|
||||
bGPdata *gpd = CTX_data_gpencil_data(C);
|
||||
ToolSettings *ts = CTX_data_tool_settings(C);
|
||||
Brush *brush = BKE_brush_getactive_gpencil(ts);
|
||||
return (gpd && (gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush) &&
|
||||
return ((gpd) && (gpd->flag & GP_DATA_STROKE_PAINTMODE) &&
|
||||
(brush && brush->gpencil_settings) &&
|
||||
(brush->gpencil_settings->brush_type == GP_BRUSH_TYPE_DRAW));
|
||||
}
|
||||
|
||||
@@ -140,7 +141,8 @@ static bool gp_stroke_paintmode_erase_poll(bContext *C)
|
||||
bGPdata *gpd = CTX_data_gpencil_data(C);
|
||||
ToolSettings *ts = CTX_data_tool_settings(C);
|
||||
Brush *brush = BKE_brush_getactive_gpencil(ts);
|
||||
return (gpd && (gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush) &&
|
||||
return ((gpd) && (gpd->flag & GP_DATA_STROKE_PAINTMODE) &&
|
||||
(brush && brush->gpencil_settings) &&
|
||||
(brush->gpencil_settings->brush_type == GP_BRUSH_TYPE_ERASE));
|
||||
}
|
||||
|
||||
@@ -151,7 +153,8 @@ static bool gp_stroke_paintmode_fill_poll(bContext *C)
|
||||
bGPdata *gpd = CTX_data_gpencil_data(C);
|
||||
ToolSettings *ts = CTX_data_tool_settings(C);
|
||||
Brush *brush = BKE_brush_getactive_gpencil(ts);
|
||||
return (gpd && (gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush) &&
|
||||
return ((gpd) && (gpd->flag & GP_DATA_STROKE_PAINTMODE) &&
|
||||
(brush && brush->gpencil_settings) &&
|
||||
(brush->gpencil_settings->brush_type == GP_BRUSH_TYPE_FILL));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user