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:
Antonio Vazquez 2021-08-09 12:07:59 +02:00
parent 0986992dbd
commit d6f162dfa9
Notes: blender-bot 2024-01-31 11:35:08 +01:00
Referenced by issue #90540, NoneType object error with entering grease pencil draw mode
1 changed files with 1 additions and 1 deletions

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