From 3e926475e0ad2e7fa0d8e135f164e117dd92909f Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 14 Nov 2024 12:38:29 +0100 Subject: [PATCH] Fix crash when checking the sync file status 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 --- src/gui/folder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 36918327fa4..f15b365c0be 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -408,7 +408,7 @@ bool Folder::syncPaused() const bool Folder::canSync() const { - return !syncPaused() && accountState()->readyForSync() && isReady() && _accountState->account()->hasCapabilities() && _folderWatcher; + return _engine && !syncPaused() && accountState()->readyForSync() && isReady() && _accountState->account()->hasCapabilities() && _folderWatcher; } bool Folder::isReady() const