From 761e807cd56cebfc504492d69d9d36e598e0682a Mon Sep 17 00:00:00 2001 From: Florian Foinant-Willig Date: Sun, 11 Jun 2023 09:30:08 +0200 Subject: [PATCH] PartDesign: UpToFace check isnull The next line crash if upToFace is null. --- src/Mod/PartDesign/App/FeatureSketchBased.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index 7f9c848764..8619cf7ece 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.cpp +++ b/src/Mod/PartDesign/App/FeatureSketchBased.cpp @@ -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) {