diff --git a/src/Mod/PartDesign/App/Body.cpp b/src/Mod/PartDesign/App/Body.cpp index c95718381..a31379f3a 100644 --- a/src/Mod/PartDesign/App/Body.cpp +++ b/src/Mod/PartDesign/App/Body.cpp @@ -333,6 +333,11 @@ Base::BoundBox3d Body::getBoundBox() Base::BoundBox3d result; Part::Feature* tipSolid = static_cast(getPrevSolidFeature()); + TopoDS_Shape sh = tipSolid->Shape.getValue(); + if (sh.IsNull()) + // This can happen when a new feature is added without having its Shape property set yet + tipSolid = static_cast(getPrevSolidFeature(NULL, false)); + if (tipSolid != NULL) { result = tipSolid->Shape.getShape().getBoundBox(); } else { diff --git a/src/Mod/PartDesign/Gui/ViewProviderDatumPlane.cpp b/src/Mod/PartDesign/Gui/ViewProviderDatumPlane.cpp index 6f855c37c..d8fbec81f 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderDatumPlane.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderDatumPlane.cpp @@ -90,6 +90,8 @@ void ViewProviderDatumPlane::updateData(const App::Property* prop) Base::BoundBox3d bbox = body->getBoundBox(); bbox = bbox.Transformed(plm.toMatrix()); double dlength = bbox.CalcDiagonalLength(); + if (dlength < Precision::Confusion()) + return; bbox.Enlarge(0.1 * dlength); // Calculate intersection of plane with bounding box edges