Fix T90540: NoneType object error with entering grease pencil draw mode

The preview was not ready when the panel was displayed.

Just need to check if None.
This commit is contained in:
2021-08-09 12:07:59 +02:00
parent 0986992dbd
commit d6f162dfa9

View File

@@ -1141,7 +1141,7 @@ def brush_basic__draw_color_selector(context, layout, brush, gp_settings, props)
if not gp_settings.use_material_pin:
ma = context.object.active_material
icon_id = 0
if ma:
if ma and ma.id_data.preview:
icon_id = ma.id_data.preview.icon_id
txt_ma = ma.name
maxw = 25