You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HersheyText::CharacterDataSet HersheyText::loadCharacterDataSet() {
CharacterDataSet dataSet;
// Check if root is an object
if (!root.isObject()) {
std::cerr << "Error: 'root' value is not an object." << std::endl;
return dataSet;
}
for (const auto& characterKey : root.getMemberNames()) {
CharacterData characterData;
characterData.character = characterKey;
const Json::Value& characterJson = root[characterKey];
if (characterJson.isArray()) {
const Json::Value& characterJson = root[characterKey];
if (!characterJson.isArray()) { //<-- Unhandled exception
std::cerr << "Warning: Data for character '" << characterKey << "' is not an array." << std::endl;
continue;
}
parsePolyline(characterJson, characterData.polylines);
}
dataSet.characters.push_back(characterData);
}
return dataSet;
}
So far the format of this JSON leads to an unhandled exception somewhere on or near the line marked with '<--'... How to solve this? What should the JSON format look like?
The text was updated successfully, but these errors were encountered:
So far the format of this JSON leads to an unhandled exception somewhere on or near the line marked with '<--'... How to solve this? What should the JSON format look like?
The text was updated successfully, but these errors were encountered: