From 69751991311a165e97a48ea67ed60e2c6022ee63 Mon Sep 17 00:00:00 2001 From: Robert Guetzkow Date: Fri, 6 Nov 2020 11:47:35 +0100 Subject: 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 --- add_mesh_extra_objects/add_mesh_round_cube.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'add_mesh_extra_objects/add_mesh_round_cube.py') diff --git a/add_mesh_extra_objects/add_mesh_round_cube.py b/add_mesh_extra_objects/add_mesh_round_cube.py index 1190be93..b48e9a69 100644 --- a/add_mesh_extra_objects/add_mesh_round_cube.py +++ b/add_mesh_extra_objects/add_mesh_round_cube.py @@ -405,7 +405,8 @@ class AddRoundCube(Operator, object_utils.AddObjectHelper): if bpy.context.mode == "OBJECT": if context.selected_objects != [] and context.active_object and \ - ('Roundcube' in context.active_object.data.keys()) and (self.change == True): + (context.active_object.data is not None) and ('Roundcube' in context.active_object.data.keys()) and \ + (self.change == True): obj = context.active_object oldmesh = obj.data oldmeshname = obj.data.name -- cgit v1.2.3