diff --git a/src/Mod/Sketcher/Gui/CommandSketcherBSpline.cpp b/src/Mod/Sketcher/Gui/CommandSketcherBSpline.cpp index e56ba9399c..7079ea7aff 100644 --- a/src/Mod/Sketcher/Gui/CommandSketcherBSpline.cpp +++ b/src/Mod/Sketcher/Gui/CommandSketcherBSpline.cpp @@ -359,6 +359,9 @@ bool isCommandNeedingBSplineKnotActive(Gui::Document* doc) } auto* Obj = static_cast(sel[0].getObject()); + if (!Obj) { + return false; + } const std::string& name = names[0]; int geoId {GeoEnum::GeoUndef}; diff --git a/src/Mod/Sketcher/Gui/Utils.cpp b/src/Mod/Sketcher/Gui/Utils.cpp index 592ac74f13..042843e91e 100644 --- a/src/Mod/Sketcher/Gui/Utils.cpp +++ b/src/Mod/Sketcher/Gui/Utils.cpp @@ -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() + if (geo && geo->is() && (PosId == Sketcher::PointPos::start || PosId == Sketcher::PointPos::end)) { return true; }