From ce3a6bba0f47cf5185ec21ede53e7ae19dd4c85f Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 10 Jun 2022 19:03:13 +1000 Subject: [PATCH] Fix bug where MS Project files with optional weekdays failed to import --- src/ifc4d/ifc4d/msp2ifc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifc4d/ifc4d/msp2ifc.py b/src/ifc4d/ifc4d/msp2ifc.py index 8a4a7d4587..470bcc435b 100644 --- a/src/ifc4d/ifc4d/msp2ifc.py +++ b/src/ifc4d/ifc4d/msp2ifc.py @@ -110,7 +110,9 @@ class MSP2Ifc: for calendar in project.find("pr:Calendars", self.ns).findall("pr:Calendar", self.ns): calendar_id = calendar.find("pr:UID", self.ns).text week_days = [] - for week_day in calendar.find("pr:WeekDays", self.ns).findall("pr:WeekDay", self.ns): + week_days_element = calendar.find("pr:WeekDays", self.ns) + week_day_elements = week_days_element.findall("pr:WeekDay", self.ns) if week_days_element else [] + for week_day in week_day_elements: working_times = [] if week_day.find("pr:WorkingTimes", self.ns): for working_time in week_day.find("pr:WorkingTimes", self.ns).findall("pr:WorkingTime", self.ns):