瀏覽代碼

SessionMixin: set currentAccount to null when no accounts are available

Prevents a crash when removing the last account

Signed-off-by: Álvaro Brey Vilas <alvaro.brey@nextcloud.com>
Álvaro Brey Vilas 3 年之前
父節點
當前提交
107dcd35c4
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/main/java/com/nextcloud/client/mixins/SessionMixin.kt

+ 1 - 0
src/main/java/com/nextcloud/client/mixins/SessionMixin.kt

@@ -91,6 +91,7 @@ class SessionMixin constructor(
         val newAccount = accountManager.currentAccount
         if (newAccount == null) {
             // no account available: force account creation
+            currentAccount = null
             startAccountCreation()
         } else {
             currentAccount = newAccount