From efc618ea87229c204af4fdf5621852a267b5cc54 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 12 Nov 2015 12:06:00 +0300 Subject: [PATCH] #1083 errors in parameter not initialized parameters info --- .../ParametersPlugin_Validators.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ParametersPlugin/ParametersPlugin_Validators.cpp b/src/ParametersPlugin/ParametersPlugin_Validators.cpp index f2a957384..d751c36ba 100644 --- a/src/ParametersPlugin/ParametersPlugin_Validators.cpp +++ b/src/ParametersPlugin/ParametersPlugin_Validators.cpp @@ -27,6 +27,15 @@ bool ParametersPlugin_VariableValidator::isValid(const AttributePtr& theAttribut std::string& theError) const { AttributeStringPtr aStrAttr = std::dynamic_pointer_cast(theAttribute); + if (!aStrAttr->isInitialized()) { + theError = "Attribute \"" + aStrAttr->id() + "\" is not initialized."; + return false; + } + bool isEmptyExpr = aStrAttr->value().empty(); + if (isEmptyExpr) { + theError = "Attribute \"" + aStrAttr->id() + "\" value is empty."; + return false; + } if (!isVariable(aStrAttr->value())) { theError = "Incorrect variable name."; return false; @@ -94,6 +103,10 @@ bool ParametersPlugin_ExpressionValidator::isValid(const AttributePtr& theAttrib AttributeStringPtr aStrAttr = std::dynamic_pointer_cast(theAttribute); + if (!aStrAttr->isInitialized()) { + theError = "Attribute \"" + aStrAttr->id() + "\" is not initialized."; + return false; + } bool isEmptyExpr = aStrAttr->value().empty(); if (isEmptyExpr) { theError = "Expression is empty."; -- 2.39.2