From: nds Date: Thu, 12 Nov 2015 09:06:00 +0000 (+0300) Subject: #1083 errors in parameter X-Git-Tag: V_2.0.0_alfa2~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=efc618ea87229c204af4fdf5621852a267b5cc54;p=modules%2Fshaper.git #1083 errors in parameter not initialized parameters info --- 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.";