Skip to content

Commit ae34439

Browse files
erikjvDeepDiver1975
authored andcommitted
Fix crash when checking the sync file status (#11982)
Sometimes a `Folder` is created for a local path that we cannot sync (e.g. it's not writable). This folder will not have a sync engine. If the engine of this `Folder` is accessed, this will lead to a crash. The fix is to check for the existance of a sync engine in the `Folder::canSync()` method. Fixes: #11981
1 parent 8f442ac commit ae34439

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gui/folder.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ bool Folder::syncPaused() const
396396

397397
bool Folder::canSync() const
398398
{
399-
return !syncPaused() && accountState()->readyForSync() && isReady() && _accountState->account()->hasCapabilities() && _folderWatcher;
399+
return _engine && !syncPaused() && accountState()->readyForSync() && isReady() && _accountState->account()->hasCapabilities() && _folderWatcher;
400400
}
401401

402402
bool Folder::isReady() const

0 commit comments

Comments
 (0)