From eafba8cbfe0ecca748bf7e1157a57f01f226fabc Mon Sep 17 00:00:00 2001 From: WandererFan Date: Mon, 22 Jan 2018 16:11:33 -0500 Subject: [PATCH] Fix Exception when Source Shape IsNull --- src/Mod/TechDraw/App/DrawViewPart.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mod/TechDraw/App/DrawViewPart.cpp b/src/Mod/TechDraw/App/DrawViewPart.cpp index 8fa99a850a..7c43e2c6cd 100644 --- a/src/Mod/TechDraw/App/DrawViewPart.cpp +++ b/src/Mod/TechDraw/App/DrawViewPart.cpp @@ -195,15 +195,20 @@ TopoDS_Shape DrawViewPart::getSourceShape(void) const BRep_Builder builder; TopoDS_Compound comp; builder.MakeCompound(comp); + bool found = false; for (auto& s:sourceShapes) { if (s.IsNull()) { continue; //has no shape } + found = true; BRepBuilderAPI_Copy BuilderCopy(s); TopoDS_Shape shape = BuilderCopy.Shape(); builder.Add(comp, shape); - } - result = comp; + } + //it appears that an empty compound is !IsNull(), so we need to check if we added anything to the compound. + if (found) { + result = comp; + } } return result; }