Sketcher: Add check for validity of geometry when trimming

Possibly solves #19425.
This commit is contained in:
Ajinkya Dahale
2025-04-15 00:27:37 +05:30
committed by Benjamin Nauck
parent 926757a258
commit 5efb8e5e76

View File

@@ -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<Part::GeomCurve>(GeoId);
if (geoAsCurve == nullptr) {
return -1;
}
bool isOriginalCurveConstruction = GeometryFacade::getConstruction(geoAsCurve);
//******************* Step A => Detection of intersection - Common to all Geometries