Catch Throwable on not only Exception

This commit is contained in:
Benoit Marty 2021-04-19 09:55:14 +02:00 committed by Benoit Marty
parent 4acc308864
commit 95639927a7
1 changed files with 3 additions and 12 deletions

View File

@ -188,10 +188,7 @@ class RoomDetailViewModel @AssistedInject constructor(
}
// Inform the SDK that the room is displayed
viewModelScope.launch(Dispatchers.IO) {
try {
session.onRoomDisplayed(initialState.roomId)
} catch (_: Throwable) {
}
tryOrNull { session.onRoomDisplayed(initialState.roomId) }
}
callManager.addPstnSupportListener(this)
callManager.checkForPSTNSupportIfNeeded()
@ -1162,19 +1159,13 @@ class RoomDetailViewModel @AssistedInject constructor(
private fun handleRejectInvite() {
viewModelScope.launch {
try {
room.leave(null)
} catch (_: Exception) {
}
tryOrNull { room.leave(null) }
}
}
private fun handleAcceptInvite() {
viewModelScope.launch {
try {
room.join()
} catch (_: Exception) {
}
tryOrNull { room.join() }
}
}