diff --git a/src/doc/kdenlivedoc.cpp b/src/doc/kdenlivedoc.cpp index 7cb9e08ba00e8ca7b61019dc86e503e99263c136..5209c57a7a511be681d0eb10b37bd9796eb0c637 100644 --- a/src/doc/kdenlivedoc.cpp +++ b/src/doc/kdenlivedoc.cpp @@ -1324,6 +1324,21 @@ void KdenliveDoc::loadDocumentProperties() QDir dir(path); dir.cdUp(); m_projectFolder = dir.absolutePath(); + bool ok; + // Ensure document storage folder is writable + QString documentId = QDir::cleanPath(getDocumentProperty(QStringLiteral("documentid"))); + documentId.toLongLong(&ok, 10); + if (ok) { + if (!dir.exists(documentId)) { + if (!dir.mkpath(documentId)) { + // Invalid storage folder, reset to default + m_projectFolder.clear(); + } + } + } else { + // Something is wrong, documentid not readable + qDebug()<<"=========\n\nCannot read document id: "<