diff options
author | Robert Guetzkow <rjg> | 2020-11-06 13:47:35 +0300 |
---|---|---|
committer | Robert Guetzkow <gitcommit@outlook.de> | 2020-11-06 13:52:09 +0300 |
commit | 69751991311a165e97a48ea67ed60e2c6022ee63 (patch) | |
tree | 43542749114b17c7b2f642ef8b59c82cc18af2e9 /add_mesh_BoltFactory | |
parent | 40e0792c3cae2cb95eef8d08d23364ca2e091eca (diff) |
Fix T82405: Check if active object's data is None
Check if the active object's data is `None` before attempting
to call functions on it. It is `None` if the object is an
empty.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D9456
Diffstat (limited to 'add_mesh_BoltFactory')
-rw-r--r-- | add_mesh_BoltFactory/Boltfactory.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/add_mesh_BoltFactory/Boltfactory.py b/add_mesh_BoltFactory/Boltfactory.py index 244d9720..330df8ae 100644 --- a/add_mesh_BoltFactory/Boltfactory.py +++ b/add_mesh_BoltFactory/Boltfactory.py @@ -428,7 +428,8 @@ class add_mesh_bolt(Operator, AddObjectHelper): if bpy.context.mode == "OBJECT": if context.selected_objects != [] and context.active_object and \ - ('Bolt' in context.active_object.data.keys()) and (self.change == True): + (context.active_object.data is not None) and ('Bolt' in context.active_object.data.keys()) and \ + (self.change == True): obj = context.active_object oldmesh = obj.data oldmeshname = obj.data.name |