From 39b67da0d7a938f0824a125e206c47ae516b66f0 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 10 Sep 2017 12:41:46 +0200 Subject: [PATCH] check for null shapes before performing boolean operation --- src/Mod/PartDesign/App/FeatureBoolean.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Mod/PartDesign/App/FeatureBoolean.cpp b/src/Mod/PartDesign/App/FeatureBoolean.cpp index b0c58855c8..796721152a 100644 --- a/src/Mod/PartDesign/App/FeatureBoolean.cpp +++ b/src/Mod/PartDesign/App/FeatureBoolean.cpp @@ -100,10 +100,17 @@ App::DocumentObjectExecReturn *Boolean::execute(void) // so that the placement will be right if(!tool->isDerivedFrom(Part::Feature::getClassTypeId())) return new App::DocumentObjectExecReturn("Cannot do boolean with anything but Part::Feature and its derivatives"); - + TopoDS_Shape shape = static_cast(tool)->Shape.getValue(); TopoDS_Shape boolOp; + // Must not pass null shapes to the boolean operations + if (result.IsNull()) + return new App::DocumentObjectExecReturn("Base shape is null"); + + if (shape.IsNull()) + return new App::DocumentObjectExecReturn("Tool shape is null"); + if (type == "Fuse") { BRepAlgoAPI_Fuse mkFuse(result, shape); if (!mkFuse.IsDone())