From: mpv Date: Fri, 20 Jul 2018 13:50:04 +0000 (+0300) Subject: Fix for the problem when referenced object is updated by modified-feature result... X-Git-Tag: SHAPER_V9_1_0RC1~73^2~42 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cb2bfff600626039e210f08de27b5229541d367a;p=modules%2Fshaper.git Fix for the problem when referenced object is updated by modified-feature result using history line. An example: Box Polyline on a box vertices Move history to the box Make another polyline on a box Move history to the end -> crash --- diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index c0a791e26..05a9998d8 100755 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -836,7 +836,7 @@ void Model_Update::updateArguments(FeaturePtr theFeature) { if (aSelAttr) { ObjectPtr aContext = aSelAttr->context(); // update argument only if the referenced object is ready to use - if (aContext.get() && !aContext->isDisabled()) { + if (aContext.get() && !aContext->isDisabled() && !aSelAttr->isInvalid()) { if (isReason(theFeature, aContext)) { if (!aSelAttr->update()) { bool isObligatory = !aFactory->isNotObligatory( @@ -846,7 +846,7 @@ void Model_Update::updateArguments(FeaturePtr theFeature) { aState = ModelAPI_StateInvalidArgument; } } - } else if (aContext.get()) { + } else if (aContext.get() || aSelAttr->isInvalid()) { // here it may be not obligatory, but if the reference is wrong, it should not be correct bool isObligatory = aFactory->isCase(theFeature, theFeature->data()->id(aSel)); if (isObligatory)