Sketcher: prevent undo/redo crash when selected geometry goes away.
Fixes #25497
This commit is contained in:
@@ -359,6 +359,9 @@ bool isCommandNeedingBSplineKnotActive(Gui::Document* doc)
|
||||
}
|
||||
|
||||
auto* Obj = static_cast<Sketcher::SketchObject*>(sel[0].getObject());
|
||||
if (!Obj) {
|
||||
return false;
|
||||
}
|
||||
const std::string& name = names[0];
|
||||
|
||||
int geoId {GeoEnum::GeoUndef};
|
||||
|
||||
@@ -355,7 +355,7 @@ bool SketcherGui::isBsplineKnotOrEndPoint(
|
||||
|
||||
const Part::Geometry* geo = Obj->getGeometry(GeoId);
|
||||
// end points of B-Splines are also knots
|
||||
if (geo->is<Part::GeomBSplineCurve>()
|
||||
if (geo && geo->is<Part::GeomBSplineCurve>()
|
||||
&& (PosId == Sketcher::PointPos::start || PosId == Sketcher::PointPos::end)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user