From e5ea670633034f032435737db22f5a4bd497742f Mon Sep 17 00:00:00 2001 From: 0penBrain <48731257+0penBrain@users.noreply.github.com> Date: Sun, 21 Nov 2021 18:58:34 +0100 Subject: [PATCH] [Sketcher][Bugfix] Fix crash when applying 'Constrain internal alignment' on contraints, fixes #4790 --- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index f6a4f0b57b..ccd25e94a6 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -7209,13 +7209,13 @@ void CmdSketcherConstrainInternalAlignment::activated(int iMsg) const Part::Geometry *geo = Obj->getGeometry(GeoId); - if (geo->getTypeId() == Part::GeomPoint::getClassTypeId()) + if (geo && geo->getTypeId() == Part::GeomPoint::getClassTypeId()) pointids.push_back(GeoId); - else if (geo->getTypeId() == Part::GeomLineSegment::getClassTypeId()) + else if (geo && geo->getTypeId() == Part::GeomLineSegment::getClassTypeId()) lineids.push_back(GeoId); - else if (geo->getTypeId() == Part::GeomEllipse::getClassTypeId()) + else if (geo && geo->getTypeId() == Part::GeomEllipse::getClassTypeId()) ellipseids.push_back(GeoId); - else if (geo->getTypeId() == Part::GeomArcOfEllipse::getClassTypeId()) + else if (geo && geo->getTypeId() == Part::GeomArcOfEllipse::getClassTypeId()) arcsofellipseids.push_back(GeoId); else { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),