allowing null users in the email search, fixes missing indentity server helpers when inviting by email

This commit is contained in:
Adam Brown 2021-10-26 11:55:52 +01:00
parent f2c22c1985
commit c90dbf2f38
1 changed files with 2 additions and 4 deletions

View File

@ -177,11 +177,9 @@ class UserListViewModel @AssistedInject constructor(@Assisted initialState: User
private suspend fun executeSearchEmail(search: String) { private suspend fun executeSearchEmail(search: String) {
suspend { suspend {
val params = listOf(ThreePid.Email(search)) val params = listOf(ThreePid.Email(search))
val foundThreePid = tryOrNull { val foundThreePid = session.identityService().lookUp(params).firstOrNull()
session.identityService().lookUp(params).firstOrNull()
}
if (foundThreePid == null) { if (foundThreePid == null) {
null ThreePidUser(email = search, user = null)
} else { } else {
try { try {
val json = session.getProfile(foundThreePid.matrixId) val json = session.getProfile(foundThreePid.matrixId)