[Bf-blender-cvs] [d6f162dfa94] master: Fix T90540: NoneType object error with entering grease pencil draw mode

Antonio Vazquez noreply at git.blender.org
Mon Aug 9 12:08:17 CEST 2021


Commit: d6f162dfa946e8745276ba594c29ce48b299a760
Author: Antonio Vazquez
Date:   Mon Aug 9 12:07:59 2021 +0200
Branches: master
https://developer.blender.org/rBd6f162dfa946e8745276ba594c29ce48b299a760

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.

===================================================================

M	release/scripts/startup/bl_ui/properties_paint_common.py

===================================================================

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



More information about the Bf-blender-cvs mailing list