From def225caa934b4d52e6539d85cbd5cb0c017d90f Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Sat, 2 Jun 2018 14:20:44 -0300 Subject: [PATCH] Arch: Fixed bug in windows presets --- src/Mod/Arch/ArchWindow.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Mod/Arch/ArchWindow.py b/src/Mod/Arch/ArchWindow.py index 87d371b49a..fe901b9949 100644 --- a/src/Mod/Arch/ArchWindow.py +++ b/src/Mod/Arch/ArchWindow.py @@ -680,11 +680,13 @@ class _CommandWindow: if os.path.exists(librarypath): for wtype in ["Windows","Doors"]: wdir = os.path.join(librarypath,"Architectural Parts",wtype) - for subtype in os.listdir(wdir): - subdir = os.path.join(wdir,subtype) - for subfile in os.listdir(subdir): - if subfile.lower().endswith(".fcstd"): - self.librarypresets.append([wtype+" - "+subtype+" - "+os.path.splitext(subfile)[0],os.path.join(subdir,subfile)]) + if os.path.exists(wdir): + for subtype in os.listdir(wdir): + subdir = os.path.join(wdir,subtype) + if os.path.exists(subdir): + for subfile in os.listdir(subdir): + if subfile.lower().endswith(".fcstd"): + self.librarypresets.append([wtype+" - "+subtype+" - "+os.path.splitext(subfile)[0],os.path.join(subdir,subfile)]) else: librarypath = None