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)`.
This commit is contained in:
Andrej730
2024-12-04 17:41:43 +05:00
parent e4597708d7
commit eb87e7e866
+1 -1
View File
@@ -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