Do not report account sync state on socket controller if we haven't received account...
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 18 Jul 2024 11:27:00 +0000 (19:27 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Tue, 23 Jul 2024 06:08:25 +0000 (14:08 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/macOS/fileprovidersocketcontroller.cpp

index 2383ddd24c7b01794839481f8c67396cd8787ff9..2c655271afede8cd9f8146ef759184ee91e47d2a 100644 (file)
@@ -227,6 +227,11 @@ void FileProviderSocketController::sendAccountDetails() const
 
 void FileProviderSocketController::reportSyncState(const QString &receivedState)
 {
+    if (!accountState()) {
+        qCWarning(lcFileProviderSocketController) << "No account state available to report sync state";
+        return;
+    }
+
     auto syncState = SyncResult::Status::Undefined;
     if (receivedState == "SYNC_PREPARING") {
         syncState = SyncResult::Status::SyncPrepare;