mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 18:35:40 +03:00
use orEmpty()
This commit is contained in:
parent
2a3694d8b7
commit
5848ec21f7
3 changed files with 3 additions and 3 deletions
|
@ -92,6 +92,6 @@ class InviteUsersToRoomViewModel @AssistedInject constructor(@Assisted
|
|||
}
|
||||
|
||||
fun getUserIdsOfRoomMembers(): Set<String> {
|
||||
return room.roomSummary()?.otherMemberIds?.toSet() ?: emptySet()
|
||||
return room.roomSummary()?.otherMemberIds?.toSet().orEmpty()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ class RoomDirectoryViewModel @AssistedInject constructor(
|
|||
val joinedRoomIds = list
|
||||
?.map { it.roomId }
|
||||
?.toSet()
|
||||
?: emptySet()
|
||||
.orEmpty()
|
||||
|
||||
setState {
|
||||
copy(joinedRoomsIds = joinedRoomIds)
|
||||
|
|
|
@ -119,7 +119,7 @@ class UserListViewModel @AssistedInject constructor(@Assisted initialState: User
|
|||
Single.just(emptyList<User>())
|
||||
} else {
|
||||
val searchObservable = session.rx()
|
||||
.searchUsersDirectory(search, 50, state.excludedUserIds ?: emptySet())
|
||||
.searchUsersDirectory(search, 50, state.excludedUserIds.orEmpty())
|
||||
.map { users ->
|
||||
users.sortedBy { it.toMatrixItem().firstLetterOfDisplayName() }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue