diff --git a/src/Mod/Sketcher/Gui/CommandSketcherTools.cpp b/src/Mod/Sketcher/Gui/CommandSketcherTools.cpp index 0fe1c42c63..3b08693b65 100644 --- a/src/Mod/Sketcher/Gui/CommandSketcherTools.cpp +++ b/src/Mod/Sketcher/Gui/CommandSketcherTools.cpp @@ -832,6 +832,12 @@ void CmdSketcherSymmetry::activated(int iMsg) // get the needed lists and objects const std::vector &SubNames = selection[0].getSubNames(); + if (SubNames.empty()) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("Select elements from a single sketch.")); + return; + } + Sketcher::SketchObject* Obj = static_cast(selection[0].getObject()); getSelection().clearSelection(); @@ -1620,6 +1626,12 @@ void CmdSketcherRectangularArray::activated(int iMsg) // get the needed lists and objects const std::vector &SubNames = selection[0].getSubNames(); + if (SubNames.empty()) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QObject::tr("Select elements from a single sketch.")); + return; + } + Sketcher::SketchObject* Obj = static_cast(selection[0].getObject()); getSelection().clearSelection();