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_star.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_star.py')
-rw-r--r-- | add_mesh_extra_objects/add_mesh_star.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/add_mesh_extra_objects/add_mesh_star.py b/add_mesh_extra_objects/add_mesh_star.py index b5d515c6..2bede081 100644 --- a/add_mesh_extra_objects/add_mesh_star.py +++ b/add_mesh_extra_objects/add_mesh_star.py @@ -208,7 +208,8 @@ class AddStar(bpy.types.Operator, object_utils.AddObjectHelper): if bpy.context.mode == "OBJECT": if context.selected_objects != [] and context.active_object and \ - ('Star' in context.active_object.data.keys()) and (self.change == True): + (context.active_object.data is not None) and ('Star' in context.active_object.data.keys()) and \ + (self.change == True): obj = context.active_object oldmesh = obj.data oldmeshname = obj.data.name |