From 5efb8e5e7634fb8ab01f020f86bc384f166186aa Mon Sep 17 00:00:00 2001 From: Ajinkya Dahale Date: Tue, 15 Apr 2025 00:27:37 +0530 Subject: [PATCH] Sketcher: Add check for validity of geometry when trimming Possibly solves #19425. --- src/Mod/Sketcher/App/SketchObject.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 37edde5188..f1f4c728cc 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -3324,6 +3324,11 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point) // FIXME: we should be able to transfer these to new curves smoothly // auto geo = getGeometry(GeoId); const auto* geoAsCurve = getGeometry(GeoId); + + if (geoAsCurve == nullptr) { + return -1; + } + bool isOriginalCurveConstruction = GeometryFacade::getConstruction(geoAsCurve); //******************* Step A => Detection of intersection - Common to all Geometries