From ab8a39698b678a28786ecbcc5e1399bcb25d808c Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Mon, 10 Dec 2018 19:41:02 -0200 Subject: [PATCH] Arch: small optimization in Arch Reference --- src/Mod/Arch/ArchReference.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Mod/Arch/ArchReference.py b/src/Mod/Arch/ArchReference.py index 6397f87b51..a7e90e1f34 100644 --- a/src/Mod/Arch/ArchReference.py +++ b/src/Mod/Arch/ArchReference.py @@ -323,11 +323,12 @@ class ViewProviderArchReference: def updateData(self,obj,prop): if (prop == "Shape") and hasattr(obj.ViewObject,"UpdateColors") and obj.ViewObject.UpdateColors: - colors = obj.Proxy.getColors(obj) - if colors: - obj.ViewObject.DiffuseColor = colors - from DraftGui import todo - DraftGui.todo.delay(self.recolorize,obj.ViewObject) + if obj.Shape and not obj.Shape.isNull(): + colors = obj.Proxy.getColors(obj) + if colors: + obj.ViewObject.DiffuseColor = colors + from DraftGui import todo + todo.delay(self.recolorize,obj.ViewObject) def recolorize(self,vobj):