Merge pull request #641 from vector-im/feature/fix_crash

Fix crash
This commit is contained in:
Benoit Marty 2019-11-04 14:28:31 +01:00 committed by GitHub
commit a85b5af761
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View file

@ -73,6 +73,7 @@ internal class RoomMembers(private val realm: Realm,
return EventEntity
.where(realm, roomId, EventType.STATE_ROOM_MEMBER)
.sort(EventEntityFields.STATE_INDEX, Sort.DESCENDING)
.isNotNull(EventEntityFields.STATE_KEY)
.distinct(EventEntityFields.STATE_KEY)
.isNotNull(EventEntityFields.CONTENT)
}

View file

@ -76,11 +76,8 @@ class TextComposerViewModel @AssistedInject constructor(@Assisted initialState:
Observable.combineLatest<List<String>, Option<AutocompleteUserQuery>, List<User>>(
room.rx().liveRoomMemberIds(),
usersQueryObservable.throttleLast(300, TimeUnit.MILLISECONDS),
BiFunction { roomMembers, query ->
val users = roomMembers
.mapNotNull {
session.getUser(it)
}
BiFunction { roomMemberIds, query ->
val users = roomMemberIds.mapNotNull { session.getUser(it) }
val filter = query.orNull()
if (filter.isNullOrBlank()) {