PartDesign: UpToFace check isnull

The next line crash if upToFace is null.
This commit is contained in:
Florian Foinant-Willig
2023-06-11 09:30:08 +02:00
committed by Chris Hennes
parent 3d3b5b76f5
commit 761e807cd5

View File

@@ -453,6 +453,7 @@ void ProfileBased::getUpToFace(TopoDS_Face& upToFace,
const std::string& method,
const gp_Dir& dir)
{
if ((method == "UpToLast") || (method == "UpToFirst")) {
// Check for valid support object
if (support.IsNull())
@@ -522,6 +523,8 @@ void ProfileBased::getUpToFace(TopoDS_Face& upToFace,
// Check that the upToFace is either not parallel to the extrusion direction
// and that upToFace is not too near
if (upToFace.IsNull())
throw Base::ValueError("SketchBased: The UpTo-Face is null!");
BRepAdaptor_Surface upToFaceSurface(TopoDS::Face(upToFace));
BRepExtrema_DistShapeShape distSS(sketchshape, upToFace);
if (upToFaceSurface.GetType() == GeomAbs_Plane) {