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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user