diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index d63e8e6620..81e25cc7ba 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -1172,15 +1172,15 @@ void OctreeServer::domainSettingsRequestComplete() { pathToCopyFrom = oldDefaultPersistPath; } + QDir persistFileDirectory = QDir(persistPath).filePath(".."); + if (!persistFileDirectory.exists()) { + qDebug() << "Creating data directory " << persistFileDirectory.absolutePath(); + persistFileDirectory.mkpath("."); + } + if (shouldCopy) { qDebug() << "Old persist file found, copying from " << pathToCopyFrom << " to " << persistPath; - QDir persistFileDirectory = QDir(persistPath).filePath(".."); - - if (!persistFileDirectory.exists()) { - qDebug() << "Creating data directory " << persistFileDirectory.path(); - persistFileDirectory.mkpath("."); - } QFile::copy(pathToCopyFrom, persistPath); } else { qDebug() << "No existing persist file found";