diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/models/Contact.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/models/Contact.kt index c710d572..6aa539fe 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/models/Contact.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/models/Contact.kt @@ -86,9 +86,13 @@ data class Contact(val id: Int, var prefix: String, var firstName: String, var m val suffixComma = if (suffix.isEmpty()) "" else ", $suffix" val fullName = "$prefix $firstPart $lastPart$suffixComma".trim() return if (fullName.isEmpty()) { - var fullOrganization = if (organization.jobPosition.isEmpty()) "" else "${organization.jobPosition}, " - fullOrganization += organization.company - fullOrganization.trim().trimEnd(',') + if (organization.isEmpty()) { + emails.firstOrNull()?.value ?: "" + } else { + var fullOrganization = if (organization.jobPosition.isEmpty()) "" else "${organization.jobPosition}, " + fullOrganization += organization.company + fullOrganization.trim().trimEnd(',') + } } else { fullName }