diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-04-16 13:18:28 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-04-16 16:33:20 +0300 |
commit | f45b91a1c5791c6f80f4790896e70b0fa9804da1 (patch) | |
tree | 769d3c1ffc6d0dfca6bb3d3ec325759baeb1df2e | |
parent | 0ca9ce21abf03d8fd92d5c5f499af59adfa21058 (diff) |
Fix tool system Python errors if there is no active object.
-rw-r--r-- | release/scripts/startup/bl_ui/space_toolsystem_toolbar.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index ed31a847933..71d6771c487 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -957,7 +957,7 @@ class _defs_vertex_paint: if context is None: return True ob = context.active_object - return (ob.type == 'MESH' and + return (ob and ob.type == 'MESH' and (ob.data.use_paint_mask or ob.data.use_paint_mask_vertex)) @@ -979,7 +979,7 @@ class _defs_texture_paint: if context is None: return True ob = context.active_object - return (ob.type == 'MESH' and + return (ob and ob.type == 'MESH' and (ob.data.use_paint_mask)) @staticmethod @@ -1000,7 +1000,7 @@ class _defs_weight_paint: if context is None: return True ob = context.active_object - return (ob.type == 'MESH' and + return (ob and ob.type == 'MESH' and (ob.data.use_paint_mask or ob.data.use_paint_mask_vertex)) |