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) {
suspend {
val params = listOf(ThreePid.Email(search))
val foundThreePid = tryOrNull {
session.identityService().lookUp(params).firstOrNull()
}
val foundThreePid = session.identityService().lookUp(params).firstOrNull()
if (foundThreePid == null) {
null
ThreePidUser(email = search, user = null)
} else {
try {
val json = session.getProfile(foundThreePid.matrixId)