Merge pull request #6908 from vector-im/feature/bma/fix_crash
Fix crash when signing out.
This commit is contained in:
commit
1c8fccad30
|
@ -70,7 +70,7 @@ class ActiveSessionHolder @Inject constructor(
|
||||||
|
|
||||||
suspend fun clearActiveSession() {
|
suspend fun clearActiveSession() {
|
||||||
// Do some cleanup first
|
// Do some cleanup first
|
||||||
getSafeActiveSession()?.let {
|
getSafeActiveSession(startSync = false)?.let {
|
||||||
Timber.w("clearActiveSession of ${it.myUserId}")
|
Timber.w("clearActiveSession of ${it.myUserId}")
|
||||||
it.callSignalingService().removeCallListener(callManager)
|
it.callSignalingService().removeCallListener(callManager)
|
||||||
it.removeListener(sessionListener)
|
it.removeListener(sessionListener)
|
||||||
|
@ -91,8 +91,8 @@ class ActiveSessionHolder @Inject constructor(
|
||||||
return activeSessionReference.get() != null || authenticationService.hasAuthenticatedSessions()
|
return activeSessionReference.get() != null || authenticationService.hasAuthenticatedSessions()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getSafeActiveSession(): Session? {
|
fun getSafeActiveSession(startSync: Boolean = true): Session? {
|
||||||
return runBlocking { getOrInitializeSession(startSync = true) }
|
return runBlocking { getOrInitializeSession(startSync = startSync) }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getActiveSession(): Session {
|
fun getActiveSession(): Session {
|
||||||
|
|
Loading…
Reference in New Issue