Эх сурвалжийг харах

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 жил өмнө
parent
commit
107dcd35c4

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

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