diff --git a/source/core/StarJsonParser.hpp b/source/core/StarJsonParser.hpp index c7a9cc6..d814edb 100644 --- a/source/core/StarJsonParser.hpp +++ b/source/core/StarJsonParser.hpp @@ -521,12 +521,13 @@ public: } void endObject() { - if (currentState() == ObjectElement) { + bool isNotEmpty = currentState() == ObjectElement; + popState(Object); + if (isNotEmpty) { if (m_pretty) write('\n'); indent(); } - popState(Object); write('}'); }