Fix a crash (#548)

This commit is contained in:
Benoit Marty 2020-07-08 22:09:39 +02:00
parent 6ceac578a3
commit f51568b331

View file

@ -92,10 +92,11 @@ class PhoneBookController @Inject constructor(
avatarRenderer(avatarRenderer)
}
mappedContact.emails
.filter { !onlyBoundContacts || it.matrixId != null }
.forEach {
.forEachIndexed { index, it ->
if (onlyBoundContacts && it.matrixId == null) return@forEachIndexed
contactDetailItem {
id("$mappedContact.id${it.email}")
id("${mappedContact.id}-$index-${it.email}")
threePid(it.email)
matrixId(it.matrixId)
clickListener {
@ -108,10 +109,11 @@ class PhoneBookController @Inject constructor(
}
}
mappedContact.msisdns
.filter { !onlyBoundContacts || it.matrixId != null }
.forEach {
.forEachIndexed { index, it ->
if (onlyBoundContacts && it.matrixId == null) return@forEachIndexed
contactDetailItem {
id("$mappedContact.id${it.phoneNumber}")
id("${mappedContact.id}-$index-${it.phoneNumber}")
threePid(it.phoneNumber)
matrixId(it.matrixId)
clickListener {