From dc1946c16b28ef51b9dab62c8ff3fc405ff1f113 Mon Sep 17 00:00:00 2001 From: sbh Date: Thu, 27 Nov 2014 14:10:19 +0300 Subject: [PATCH] Issue #278 Threat "Action" features as valid, even if it has no data. --- src/Model/Model_FeatureValidator.cpp | 6 ++++-- src/Model/Model_Validator.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Model/Model_FeatureValidator.cpp b/src/Model/Model_FeatureValidator.cpp index 2bbad12d1..9f3ab4a13 100644 --- a/src/Model/Model_FeatureValidator.cpp +++ b/src/Model/Model_FeatureValidator.cpp @@ -15,8 +15,10 @@ bool Model_FeatureValidator::isValid(const std::shared_ptr& th const std::list& theArguments) const { std::shared_ptr aData = theFeature->data(); - if (!aData) - return false; + // "Action" features has no data, but still valid. e.g "Remove Part" + if (!aData) { + return theFeature->isAction(); + } if (!aData->isValid()) return false; const std::string kAllTypes = ""; diff --git a/src/Model/Model_Validator.cpp b/src/Model/Model_Validator.cpp index 501b91b2f..d8967d0e6 100644 --- a/src/Model/Model_Validator.cpp +++ b/src/Model/Model_Validator.cpp @@ -175,10 +175,12 @@ bool Model_ValidatorsFactory::validate(const std::shared_ptr& return false; } } + // check all attributes for validity std::shared_ptr aData = theFeature->data(); - if (!aData || !aData->isValid()) - return false; + // Validity of data is checked by "Model_FeatureValidator" (kDefaultId) + // if (!aData || !aData->isValid()) + // return false; static const std::string kAllTypes = ""; std::map >::const_iterator aFeatureIter = myAttrs.find(theFeature->getKind()); -- 2.39.2