From e06591bbbdd565cc7e9134141cfdb826ee5db9d0 Mon Sep 17 00:00:00 2001 From: Gorgious56 Date: Thu, 29 Jul 2021 09:03:53 +0200 Subject: [PATCH] Prevent linking non-existant or non-ifc file (#1604) --- src/blenderbim/blenderbim/bim/operator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blenderbim/blenderbim/bim/operator.py b/src/blenderbim/blenderbim/bim/operator.py index 9c6b5b31f7..1576439c06 100644 --- a/src/blenderbim/blenderbim/bim/operator.py +++ b/src/blenderbim/blenderbim/bim/operator.py @@ -153,7 +153,8 @@ class SelectIfcFile(bpy.types.Operator): filter_glob: bpy.props.StringProperty(default="*.ifc;*.ifczip;*.ifcxml", options={"HIDDEN"}) def execute(self, context): - bpy.context.scene.BIMProperties.ifc_file = self.filepath + if os.path.exists(self.filepath) and "ifc" in os.path.splitext(self.filepath)[1]: + bpy.context.scene.BIMProperties.ifc_file = self.filepath return {"FINISHED"} def invoke(self, context, event):