Merge pull request #3586 from nextcloud/bugfix/fix-crash-folder-isSyncRunning

Fix crash in Folder::isSyncRunning()
This commit is contained in:
Matthieu Gallien 2021-07-28 11:25:17 +02:00 committed by GitHub
commit 1e91e1bd96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -252,7 +252,7 @@ bool Folder::isBusy() const
bool Folder::isSyncRunning() const
{
return _engine->isSyncRunning() || _vfs->isHydrating();
return _engine->isSyncRunning() || (_vfs && _vfs->isHydrating());
}
QString Folder::remotePath() const

View File

@ -57,6 +57,12 @@ private slots:
QVERIFY(folderman->addFolder(newAccountState.data(), folderDefinition(dirPath + "/sub/ownCloud1")));
QVERIFY(folderman->addFolder(newAccountState.data(), folderDefinition(dirPath + "/ownCloud2")));
const auto folderList = folderman->map();
for (const auto &folder : folderList) {
QVERIFY(!folder->isSyncRunning());
}
// those should be allowed
// QString FolderMan::checkPathValidityForNewFolder(const QString& path, const QUrl &serverUrl, bool forNewDirectory)