Browse Source

Util: Fix empty Object {} parsing

master
Riyyi 2 years ago
parent
commit
39329caf22
  1. 3
      src/util/json/parser.cpp

3
src/util/json/parser.cpp

@ -393,7 +393,7 @@ Value Parser::getObject()
break; break;
} }
token = peek(); token = consume();
if (token.type == Token::Type::BraceClose) { if (token.type == Token::Type::BraceClose) {
// Trailing comma // Trailing comma
if (object.asObject().size() > 0) { if (object.asObject().size() > 0) {
@ -408,6 +408,7 @@ Value Parser::getObject()
} }
// Find member name // Find member name
m_index--;
Value tmpName = getString(); Value tmpName = getString();
if (tmpName.type() != Value::Type::String) { if (tmpName.type() != Value::Type::String) {
seekForward(Token::Type::BraceClose); seekForward(Token::Type::BraceClose);

Loading…
Cancel
Save