Check for nullability
This commit is contained in:
parent
c51646d519
commit
317cb9b883
2 changed files with 12 additions and 4 deletions
|
|
@ -367,8 +367,12 @@ class ThreadAdapter(
|
|||
thread_mesage_attachments_holder.addView(vCardView)
|
||||
|
||||
parseVCardFromUri(context, uri) { vCards ->
|
||||
val title = vCards.first().formattedName.value
|
||||
val imageIcon = SimpleContactsHelper(context).getContactLetterIcon(title)
|
||||
val title = vCards.firstOrNull()?.formattedName?.value
|
||||
val imageIcon = if (title != null) {
|
||||
SimpleContactsHelper(context).getContactLetterIcon(title)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
activity.runOnUiThread {
|
||||
vCardView.apply {
|
||||
vcard_title.text = title
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue