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_extra_objects/add_mesh_pipe_joint.py | |
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_extra_objects/add_mesh_pipe_joint.py')
-rw-r--r-- | add_mesh_extra_objects/add_mesh_pipe_joint.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/add_mesh_extra_objects/add_mesh_pipe_joint.py b/add_mesh_extra_objects/add_mesh_pipe_joint.py index 98421331..91c64e2f 100644 --- a/add_mesh_extra_objects/add_mesh_pipe_joint.py +++ b/add_mesh_extra_objects/add_mesh_pipe_joint.py @@ -230,7 +230,8 @@ class AddElbowJoint(Operator, object_utils.AddObjectHelper): if bpy.context.mode == "OBJECT": if (context.selected_objects != []) and context.active_object and \ - ('ElbowJoint' in context.active_object.data.keys()) and (self.change == True): + (context.active_object.data is not None) and ('ElbowJoint' in context.active_object.data.keys()) and \ + (self.change == True): obj = context.active_object oldmesh = obj.data oldmeshname = obj.data.name @@ -496,7 +497,8 @@ class AddTeeJoint(Operator, object_utils.AddObjectHelper): if bpy.context.mode == "OBJECT": if (context.selected_objects != []) and context.active_object and \ - ('TeeJoint' in context.active_object.data.keys()) and (self.change == True): + (context.active_object.data is not None) and ('TeeJoint' in context.active_object.data.keys()) and \ + (self.change == True): obj = context.active_object oldmesh = obj.data oldmeshname = obj.data.name @@ -779,7 +781,8 @@ class AddWyeJoint(Operator, object_utils.AddObjectHelper): if bpy.context.mode == "OBJECT": if (context.selected_objects != []) and context.active_object and \ - ('WyeJoint' in context.active_object.data.keys()) and (self.change == True): + (context.active_object.data is not None) and ('WyeJoint' in context.active_object.data.keys()) and \ + (self.change == True): obj = context.active_object oldmesh = obj.data oldmeshname = obj.data.name @@ -1126,7 +1129,8 @@ class AddCrossJoint(Operator, object_utils.AddObjectHelper): if bpy.context.mode == "OBJECT": if (context.selected_objects != []) and context.active_object and \ - ('CrossJoint' in context.active_object.data.keys()) and (self.change == True): + (context.active_object.data is not None) and ('CrossJoint' in context.active_object.data.keys()) and \ + (self.change == True): obj = context.active_object oldmesh = obj.data oldmeshname = obj.data.name @@ -1370,7 +1374,8 @@ class AddNJoint(Operator, object_utils.AddObjectHelper): if bpy.context.mode == "OBJECT": if (context.selected_objects != []) and context.active_object and \ - ('NJoint' in context.active_object.data.keys()) and (self.change == True): + (context.active_object.data is not None) and ('NJoint' in context.active_object.data.keys()) and \ + (self.change == True): obj = context.active_object oldmesh = obj.data oldmeshname = obj.data.name |