mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
GetOngoingVoiceBroadcastsUseCase: Return empty list if there is no session
This commit is contained in:
parent
c20f6fe326
commit
cb5fc75c5d
@ -31,8 +31,11 @@ class GetOngoingVoiceBroadcastsUseCase @Inject constructor(
|
||||
) {
|
||||
|
||||
fun execute(roomId: String): List<VoiceBroadcastEvent> {
|
||||
val session = activeSessionHolder.getSafeActiveSession()
|
||||
val room = session?.getRoom(roomId) ?: error("Unknown roomId: $roomId")
|
||||
val session = activeSessionHolder.getSafeActiveSession() ?: run {
|
||||
Timber.d("## GetOngoingVoiceBroadcastsUseCase: no active session")
|
||||
return emptyList()
|
||||
}
|
||||
val room = session.getRoom(roomId) ?: error("Unknown roomId: $roomId")
|
||||
|
||||
Timber.d("## GetLastVoiceBroadcastUseCase: get last voice broadcast in $roomId")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user