From d6f162dfa946e8745276ba594c29ce48b299a760 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Mon, 9 Aug 2021 12:07:59 +0200 Subject: 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. --- release/scripts/startup/bl_ui/properties_paint_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py index 97a0c5abf24..ad963396022 100644 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -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 -- cgit v1.2.3