1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

properly initialize settings when configuration was not found

This commit is contained in:
Ivan Savenko
2013-04-02 21:39:32 +00:00
parent c927913f5f
commit 0307639c32
4 changed files with 34 additions and 9 deletions

View File

@@ -1080,14 +1080,19 @@ std::string JsonValidator::fail(const std::string &message)
{
std::string errors;
errors += "At ";
BOOST_FOREACH(const JsonNode &path, currentPath)
if (!currentPath.empty())
{
errors += "/";
if (path.getType() == JsonNode::DATA_STRING)
errors += path.String();
else
errors += boost::lexical_cast<std::string>(static_cast<unsigned>(path.Float()));
BOOST_FOREACH(const JsonNode &path, currentPath)
{
errors += "/";
if (path.getType() == JsonNode::DATA_STRING)
errors += path.String();
else
errors += boost::lexical_cast<std::string>(static_cast<unsigned>(path.Float()));
}
}
else
errors += "<root>";
errors += "\n\t Error: " + message + "\n";
return errors;
}