From eb87e7e8663c9f32cd94a77d27a3872e22d4d19b Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 4 Dec 2024 17:41:43 +0500 Subject: [PATCH] Fix UI errors when selecting directories in file browser It was only checking if it's existing path but wasn't checking whether it's a file, therefore directories with suffixes were slipping in and then failing during `IfcHeaderExtractor(filepath)`. --- src/bonsai/bonsai/bim/ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/bim/ui.py b/src/bonsai/bonsai/bim/ui.py index b9efb43939..0e7ce9f1b1 100644 --- a/src/bonsai/bonsai/bim/ui.py +++ b/src/bonsai/bonsai/bim/ui.py @@ -50,7 +50,7 @@ class IFCFileSelector: path = self.get_filepath_abs() else: path = Path(filepath) - return path.exists() and "ifc" in path.suffix.lower() + return path.exists() and path.is_file() and "ifc" in path.suffix.lower() def get_filepath_abs(self) -> Path: # self.filepath filled by fileselect_add is absolute