diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-10-10 15:00:14 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-10-10 16:09:12 +0300 |
commit | 074cbc403cb5498fddb1f963317fcd67b227c7c6 (patch) | |
tree | 8d08c24d4195db4b1865be3f76c60972208e3d3e /release | |
parent | ae3ac8062f4786938fcbd3cbe1b0151a54818821 (diff) |
Fix material properties Python error when there is no active object.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_material_gpencil.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py b/release/scripts/startup/bl_ui/properties_material_gpencil.py index cdd39497db5..5fb9d9795e3 100644 --- a/release/scripts/startup/bl_ui/properties_material_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py @@ -157,11 +157,14 @@ class MATERIAL_PT_gpencil_surface(GPMaterialButtonsPanel, Panel): @classmethod def poll(cls, context): ob = context.object + if ob is None: + return False + ma = context.object.active_material if ma is None or ma.grease_pencil is None: return False - return ob and ob.type == 'GPENCIL' + return ob.type == 'GPENCIL' def draw_header_preset(self, context): MATERIAL_PT_gpencil_material_presets.draw_panel_header(self.layout) |