diff --git a/tools/oven/src/DomainBaker.cpp b/tools/oven/src/DomainBaker.cpp index 3444077922..3c06ec1096 100644 --- a/tools/oven/src/DomainBaker.cpp +++ b/tools/oven/src/DomainBaker.cpp @@ -752,10 +752,11 @@ void DomainBaker::writeNewEntitiesFile() { // time to write out a main models.json.gz file // first setup a document with the entities array below the entities key - _json.object()[ENTITIES_OBJECT_KEY] = _entities; + QJsonObject json = _json.object(); + json[ENTITIES_OBJECT_KEY] = _entities; // turn that QJsonDocument into a byte array ready for compression - QByteArray jsonByteArray = _json.toJson(); + QByteArray jsonByteArray = QJsonDocument(json).toJson(); // compress the json byte array using gzip QByteArray compressedJson;