From dfc8fd457f581aad52285d0a5b289e3215b189db Mon Sep 17 00:00:00 2001 From: mpv Date: Fri, 28 Feb 2020 14:43:55 +0300 Subject: [PATCH] Fix for the issue #3143 : Number of parts is wrong for document with Linear copy --- src/Model/Model_Objects.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Model/Model_Objects.cpp b/src/Model/Model_Objects.cpp index 047a4c105..6d40674d3 100644 --- a/src/Model/Model_Objects.cpp +++ b/src/Model/Model_Objects.cpp @@ -1888,10 +1888,12 @@ void Model_Objects::updateResults(FeaturePtr theFeature, std::set& t if (aResIndex <= theFeature->results().size()) { // to avoid crash if previous execute // for index = 0 erases result std::shared_ptr aNewP = createPart(theFeature->data(), aResIndex); - theFeature->setResult(aNewP, aResIndex); - if (!aNewP->partDoc().get()) - // create the part result: it is better to restore the previous result if possible - theFeature->execute(); + if (!aNewP->data()->isDeleted()) { + theFeature->setResult(aNewP, aResIndex); + if (!aNewP->partDoc().get()) + // create the part result: it is better to restore the previous result if possible + theFeature->execute(); + } } } else if (aGroup->Get() == ModelAPI_ResultConstruction::group().c_str()) { ResultConstructionPtr aConstr = createConstruction(theFeature->data(), aResIndex); -- 2.39.2