From 007bcbdc7f08d9904f03142be48768e142d4d49e Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 16 May 2014 15:34:26 +0200 Subject: [PATCH] + fix crash in CmdSketcherMapSketch --- src/Mod/Sketcher/Gui/Command.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Mod/Sketcher/Gui/Command.cpp b/src/Mod/Sketcher/Gui/Command.cpp index 9665f6a89..3965b890d 100644 --- a/src/Mod/Sketcher/Gui/Command.cpp +++ b/src/Mod/Sketcher/Gui/Command.cpp @@ -299,7 +299,14 @@ void CmdSketcherMapSketch::activated(int iMsg) Part::Feature *part = static_cast(FaceFilter.Result[0][0].getObject()); Base::Placement ObjectPos = part->Placement.getValue(); const std::vector &sub = FaceFilter.Result[0][0].getSubNames(); - if (sub.size() > 1){ + if (sub.empty()) { + // No assert for wrong user input! + QMessageBox::warning(Gui::getMainWindow(), + qApp->translate(className(),"No sub-elements selected"), + qApp->translate(className(),"You have to select a single face as support for a sketch!")); + return; + } + else if (sub.size() > 1) { // No assert for wrong user input! QMessageBox::warning(Gui::getMainWindow(), qApp->translate(className(),"Several sub-elements selected"),