From 4ee2c5d9db3b1d56919cd321ac5ea9d421ce38d8 Mon Sep 17 00:00:00 2001 From: Stan Tomlinson Date: Thu, 9 Jan 2025 19:02:25 -0500 Subject: [PATCH] improved checks in GUI/Jobs.py/claimChildren eliminate some error messages when a Job is not fully loaded (or when not properly constructed via scripting) TESTED ON V0.21 -- code hasn't changed since then --- src/Mod/CAM/Path/Main/Gui/Job.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Mod/CAM/Path/Main/Gui/Job.py b/src/Mod/CAM/Path/Main/Gui/Job.py index f9507401b6..7ad969d099 100644 --- a/src/Mod/CAM/Path/Main/Gui/Job.py +++ b/src/Mod/CAM/Path/Main/Gui/Job.py @@ -265,13 +265,14 @@ class ViewProvider: def claimChildren(self): children = [] - children.append(self.obj.Operations) + if hasattr(self.obj, "Operations"): + children.append(self.obj.Operations) if hasattr(self.obj, "Model"): # unfortunately this function is called before the object has been fully loaded # which means we could be dealing with an old job which doesn't have the new Model # yet. children.append(self.obj.Model) - if self.obj.Stock: + if hasattr(self.obj, "Stock"): children.append(self.obj.Stock) if hasattr(self.obj, "SetupSheet"): # when loading a job that didn't have a setup sheet they might not've been created yet