From 41d3b8e362cefd0e733fda4ba7bd38db1fe27bbf Mon Sep 17 00:00:00 2001 From: mpv Date: Fri, 20 Jul 2018 16:50:04 +0300 Subject: [PATCH] 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 --- src/Model/Model_Update.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.39.2