From 0990dfd3721b0e1b5106d618fb6a72a444144ecc Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 2 Apr 2025 12:41:34 +0500 Subject: [PATCH] biim.load_link - error if file does not exist Noticed investigating #6403 --- src/bonsai/bonsai/bim/module/project/operator.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bonsai/bonsai/bim/module/project/operator.py b/src/bonsai/bonsai/bim/module/project/operator.py index 68180a5e21..57b23450b0 100644 --- a/src/bonsai/bonsai/bim/module/project/operator.py +++ b/src/bonsai/bonsai/bim/module/project/operator.py @@ -1304,6 +1304,9 @@ class LoadLink(bpy.types.Operator): def execute(self, context): filepath = Path(tool.Ifc.resolve_uri(self.filepath)) + if not filepath.exists(): + self.report({"ERROR"}, f"File does not exist: '{filepath}'") + return {"CANCELLED"} self.filepath_ = filepath if filepath.suffix.lower().endswith(".blend"): self.link_blend(filepath)