Case20410 Automatic Content Archives doesn't restore correctly with old Tutorial content set

The tutorial content set had a content set Id of Null, which caused a failure
to parse the content set.
This commit is contained in:
Roxanne Skelly 2019-04-02 13:19:06 -07:00
parent 6ccf16dfe5
commit 2d71ec1c75
2 changed files with 12 additions and 3 deletions

View file

@ -1734,7 +1734,7 @@ void DomainServer::processOctreeDataPersistMessage(QSharedPointer<ReceivedMessag
f.write(data);
OctreeUtils::RawEntityData entityData;
if (entityData.readOctreeDataInfoFromData(data)) {
qCDebug(domain_server) << "Wrote new entities file" << entityData.id << entityData.version;
qCDebug(domain_server) << "Wrote new entities file" << entityData.id << entityData.dataVersion;
} else {
qCDebug(domain_server) << "Failed to read new octree data info";
}

View file

@ -97,7 +97,7 @@ bool OctreeEntitiesFileParser::parseEntities(QVariantMap& parsedEntities) {
_errorString = "Duplicate Id entries";
return false;
}
gotId = true;
if (nextToken() != '"') {
_errorString = "Invalid Id value";
return false;
@ -107,6 +107,16 @@ bool OctreeEntitiesFileParser::parseEntities(QVariantMap& parsedEntities) {
_errorString = "Invalid Id string";
return false;
}
if (idString == "{00000000-0000-0000-0000-000000000000}") {
// some older archives may have a null string id, so
// return success without setting parsedEntities,
// which will result in a new uuid for the restored
// archive. (not parsing and using isNull as parsing
// results in null if there is a corrupt string)
return true;
}
QUuid idValue = QUuid::fromString(QLatin1String(idString.c_str()) );
if (idValue.isNull()) {
_errorString = "Id value invalid UUID string: " + idString;
@ -114,7 +124,6 @@ bool OctreeEntitiesFileParser::parseEntities(QVariantMap& parsedEntities) {
}
parsedEntities["Id"] = idValue;
gotId = true;
} else if (key == "Version") {
if (gotVersion) {
_errorString = "Duplicate Version entries";