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 bool Folder::isSyncRunning() const
{ {
return _engine->isSyncRunning() || _vfs->isHydrating(); return _engine->isSyncRunning() || (_vfs && _vfs->isHydrating());
} }
QString Folder::remotePath() const 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 + "/sub/ownCloud1")));
QVERIFY(folderman->addFolder(newAccountState.data(), folderDefinition(dirPath + "/ownCloud2"))); 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 // those should be allowed
// QString FolderMan::checkPathValidityForNewFolder(const QString& path, const QUrl &serverUrl, bool forNewDirectory) // QString FolderMan::checkPathValidityForNewFolder(const QString& path, const QUrl &serverUrl, bool forNewDirectory)