mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-22 21:15:30 +03:00
ensure that there is always a current user
this should also fix the app to start after it always crashed on startup because of https://github.com/nextcloud/talk-android/issues/2531 Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
dd155db6ab
commit
e238c4c9e5
2 changed files with 2 additions and 1 deletions
|
@ -295,7 +295,7 @@ class ConversationsListController(bundle: Bundle) :
|
|||
}
|
||||
fetchRooms()
|
||||
} else {
|
||||
Log.e(TAG, "currentUser was null in ConversationsListController.onAttach")
|
||||
Log.e(TAG, "userManager.currentUser.blockingGet() returned null")
|
||||
Toast.makeText(context, R.string.nc_common_error_sorry, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ class UserManager internal constructor(private val userRepository: UsersReposito
|
|||
val currentUser: Maybe<User>
|
||||
get() {
|
||||
return userRepository.getActiveUser()
|
||||
.switchIfEmpty(getAnyUserAndSetAsActive())
|
||||
}
|
||||
|
||||
val currentUserObservable: Observable<User>
|
||||
|
|
Loading…
Reference in a new issue