From 03ce0f276e768428f0ffdac6a7d219d25834afb0 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 15 Mar 2018 11:13:45 +0100 Subject: [PATCH] fixes #0003376: PartDesign Boolean produces exception with wrong selection of active Body --- src/Mod/PartDesign/Gui/Command.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index 63c4e678fe..3492bcf408 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -2185,7 +2185,7 @@ void CmdPartDesignBoolean::activated(int iMsg) openCommand("Create Boolean"); std::string FeatName = getUniqueObjectName("Boolean"); doCommand(Doc,"App.activeDocument().%s.newObject('PartDesign::Boolean','%s')", pcActiveBody->getNameInDocument(), FeatName.c_str()); - + if (BodyFilter.match() && !BodyFilter.Result.empty()) { std::vector bodies; std::vector >::iterator i = BodyFilter.Result.begin(); @@ -2195,8 +2195,11 @@ void CmdPartDesignBoolean::activated(int iMsg) bodies.push_back(j->getObject()); } } - std::string bodyString = PartDesignGui::buildLinkListPythonStr(bodies); - doCommand(Doc,"App.activeDocument().%s.addObjects(%s)",FeatName.c_str(),bodyString.c_str()); + + if (!bodies.empty()) { + std::string bodyString = PartDesignGui::buildLinkListPythonStr(bodies); + doCommand(Doc,"App.activeDocument().%s.addObjects(%s)",FeatName.c_str(),bodyString.c_str()); + } } finishFeature(this, FeatName, nullptr, false);