From 672cfe9c85e2ac71b97b5331d9034d23c9723d71 Mon Sep 17 00:00:00 2001 From: "Vladimir Spivak(cwolf3d)" Date: Thu, 3 Dec 2020 00:04:56 +0200 Subject: Fixed errors in the console if obj.data is None Errors appeared when calling the context menu on an object without data --- add_mesh_BoltFactory/Boltfactory.py | 2 +- add_mesh_extra_objects/__init__.py | 2 +- add_mesh_geodesic_domes/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/add_mesh_BoltFactory/Boltfactory.py b/add_mesh_BoltFactory/Boltfactory.py index 330df8ae..f2646704 100644 --- a/add_mesh_BoltFactory/Boltfactory.py +++ b/add_mesh_BoltFactory/Boltfactory.py @@ -481,7 +481,7 @@ def Bolt_contex_menu(self, context): obj = context.object layout = self.layout - if 'Bolt' in obj.data.keys(): + if obj.data is not None and 'Bolt' in obj.data.keys(): props = layout.operator("mesh.bolt_add", text="Change Bolt") props.change = True for prm in BoltParameters(): diff --git a/add_mesh_extra_objects/__init__.py b/add_mesh_extra_objects/__init__.py index fa7918ef..8a697ae5 100644 --- a/add_mesh_extra_objects/__init__.py +++ b/add_mesh_extra_objects/__init__.py @@ -249,7 +249,7 @@ def Extras_contex_menu(self, context): obj = context.object layout = self.layout - if obj == None: + if obj == None or obj.data is None: return if 'Gear' in obj.data.keys(): diff --git a/add_mesh_geodesic_domes/__init__.py b/add_mesh_geodesic_domes/__init__.py index 00ee10aa..e88f3184 100644 --- a/add_mesh_geodesic_domes/__init__.py +++ b/add_mesh_geodesic_domes/__init__.py @@ -54,7 +54,7 @@ def Geodesic_contex_menu(self, context): obj = context.object layout = self.layout - if 'GeodesicDome' in obj.data.keys(): + if obj.data is not None and 'GeodesicDome' in obj.data.keys(): props = layout.operator("mesh.generate_geodesic_dome", text="Change Geodesic Dome") props.change = True for prm in third_domes_panel_271.GeodesicDomeParameters(): -- cgit v1.2.3