From 18d26df24ed392b59027c7d93c508b653ba35285 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 30 Jun 2023 13:42:01 +0500 Subject: [PATCH] Fixing ifc git poll errors if .ifc file is not yet saved Errors: Traceback (most recent call last): File "\Blender\3.6\scripts\addons\blenderbim\bim\module\ifcgit\operator.py", line 20, in poll if not os.path.isfile(path_ifc): File "\Blender\3.6\python\lib\genericpath.py", line 30, in isfile st = os.stat(path) TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType Traceback (most recent call last): File "\Blender\3.6\scripts\addons\blenderbim\bim\module\ifcgit\operator.py", line 48, in poll if not os.path.isfile(path_ifc): File "\Blender\3.6\python\lib\genericpath.py", line 30, in isfile st = os.stat(path) TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType --- src/blenderbim/blenderbim/bim/module/ifcgit/operator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/ifcgit/operator.py b/src/blenderbim/blenderbim/bim/module/ifcgit/operator.py index 2d1c5094b9..6ff9f67a20 100644 --- a/src/blenderbim/blenderbim/bim/module/ifcgit/operator.py +++ b/src/blenderbim/blenderbim/bim/module/ifcgit/operator.py @@ -17,7 +17,7 @@ class CreateRepo(bpy.types.Operator): def poll(cls, context): IfcGitData.make_sure_is_loaded() path_ifc = IfcGitData.data["path_ifc"] - if not os.path.isfile(path_ifc): + if not path_ifc or not os.path.isfile(path_ifc): return False if IfcGitData.data["repo"]: # repo already exists @@ -45,7 +45,7 @@ class AddFileToRepo(bpy.types.Operator): def poll(cls, context): IfcGitData.make_sure_is_loaded() path_ifc = IfcGitData.data["path_ifc"] - if not os.path.isfile(path_ifc): + if not path_ifc or not os.path.isfile(path_ifc): return False if not IfcGitData.data["repo"]: # repo doesn't exist