From 4ea0c730819a65c16063a0db09897d59aa3db7c1 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 25 Mar 2022 19:37:52 +1100 Subject: [PATCH] Fix bug where we now accommodate invalid durations in the scheduling tree --- src/blenderbim/blenderbim/bim/module/sequence/prop.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/blenderbim/blenderbim/bim/module/sequence/prop.py b/src/blenderbim/blenderbim/bim/module/sequence/prop.py index a923352163..5c3eb6a18f 100644 --- a/src/blenderbim/blenderbim/bim/module/sequence/prop.py +++ b/src/blenderbim/blenderbim/bim/module/sequence/prop.py @@ -17,6 +17,7 @@ # along with BlenderBIM Add-on. If not, see . import bpy +import isodate import ifcopenshell.api import ifcopenshell.util.attribute from blenderbim.bim.ifc import IfcStore @@ -184,6 +185,16 @@ def updateTaskDuration(self, context): props = context.scene.BIMWorkScheduleProperties if not props.is_task_update_enabled: return + + if self.duration == "-": + return + + try: + isodate.parse_duration(self.duration), + except: + self.duration = "-" + return + self.file = IfcStore.get_file() task = self.file.by_id(self.ifc_definition_id) if task.TaskTime: