check for null shapes before performing boolean operation
This commit is contained in:
@@ -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<Part::Feature*>(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())
|
||||
|
||||
Reference in New Issue
Block a user