Fix error when adding opening with None object

This commit is contained in:
Gorgious
2021-08-19 22:05:22 +02:00
parent d1a39d8004
commit 29cda05025
@@ -35,8 +35,10 @@ class AddOpening(bpy.types.Operator):
return IfcStore.execute_ifc_operator(self, context)
def _execute(self, context):
obj = bpy.data.objects.get(self.obj) if self.obj else context.active_object
opening = bpy.data.objects.get(self.opening)
obj = context.scene.objects.get(self.obj, context.active_object)
opening = context.scene.objects.get(self.opening)
if opening is None:
return {"FINISHED"}
opening.display_type = "WIRE"
if not opening.BIMObjectProperties.ifc_definition_id:
body_context_id = None