Fix input validation in StartScriptCreator

coverity_scan
Rob Cutmore 9 years ago
parent b93b97575e
commit fbca094dda

@ -75,27 +75,15 @@ std::string CSVWorld::StartScriptCreator::getErrors() const
std::string errors;
if (scriptId.empty())
{
if (!errors.empty())
{
errors += "<br>";
}
errors += "No Script ID entered";
errors = "No Script ID entered";
}
else if (getData().getScripts().searchId(scriptId) == -1)
{
if (!errors.empty())
{
errors += "<br>";
}
errors += "Script ID not found";
errors = "Script ID not found";
}
else if (getData().getStartScripts().searchId(scriptId) > -1)
{
if (!errors.empty())
{
errors += "<br>";
}
errors += "Script with this ID already registered as Start Script";
errors = "Script with this ID already registered as Start Script";
}
return errors;

@ -50,7 +50,7 @@ namespace CSVWorld
const std::string& originId,
const CSMWorld::UniversalId::Type type);
/// \return Formatted error descriptions for current user input.
/// \return Error description for current user input.
virtual std::string getErrors() const;
/// \brief Set focus to script ID input widget.

Loading…
Cancel
Save