diff --git a/src/Mod/Sketcher/Gui/CommandSketcherTools.cpp b/src/Mod/Sketcher/Gui/CommandSketcherTools.cpp index 53c53ec6e2..aee88cd533 100644 --- a/src/Mod/Sketcher/Gui/CommandSketcherTools.cpp +++ b/src/Mod/Sketcher/Gui/CommandSketcherTools.cpp @@ -306,14 +306,14 @@ void CmdSketcherSelectConstraints::activated(int iMsg) { Q_UNUSED(iMsg); - // Cancel any in-progress operation - Gui::Document* doc = Gui::Application::Instance->activeDocument(); - SketcherGui::ReleaseHandler(doc); - // get the selection std::vector selection; selection = getSelection().getSelectionEx(0, Sketcher::SketchObject::getClassTypeId()); + // Cancel any in-progress operation + Gui::Document* doc = Gui::Application::Instance->activeDocument(); + SketcherGui::ReleaseHandler(doc); + // only one sketch with its subelements are allowed to be selected if (selection.size() != 1) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),