diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp b/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp index a6fecae2fb..72e995e808 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp @@ -450,7 +450,7 @@ void ConstraintView::contextMenuEvent (QContextMenuEvent* event) bool didRelease = SketcherGui::ReleaseHandler(doc); // Sync the FreeCAD selection with the selection in the ConstraintView widget - if (didRelease) { + if (didRelease && item) { Gui::Selection().clearSelection(); std::string doc_name = static_cast(item)->sketchView->getSketchObject()->getDocument()->getName(); std::string obj_name = static_cast(item)->sketchView->getSketchObject()->getNameInDocument();