Check if current user exists before getting it's account state
authorFelix Weilbach <felix.weilbach@nextcloud.com>
Wed, 13 Oct 2021 09:25:13 +0000 (11:25 +0200)
committerFelix Weilbach <felix.weilbach@nextcloud.com>
Wed, 13 Oct 2021 09:25:13 +0000 (11:25 +0200)
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
src/gui/tray/syncstatussummary.cpp

index a66a5d9d9e4e10e6a8f3b46f8e68358420de3916..5a2074dd3f45318d1820733d19bcb689fcb941da 100644 (file)
@@ -53,7 +53,11 @@ SyncStatusSummary::SyncStatusSummary(QObject *parent)
 
 void SyncStatusSummary::load()
 {
-    auto accountState = UserModel::instance()->currentUser()->accountState();
+    const auto currentUser = UserModel::instance()->currentUser();
+    if (!currentUser) {
+        return;
+    }
+    auto accountState = currentUser->accountState();
 
     if (_accountState.data() == accountState.data()) {
         return;