Skip to content

Commit 8dbcd26

Browse files
authored
Merge branch 'main' into alphanumeric-import
2 parents 3fc566f + 68ec3b9 commit 8dbcd26

File tree

1 file changed

+3
-1
lines changed
  • commons/src/main/kotlin/org/fossify/commons/models/contacts

1 file changed

+3
-1
lines changed

commons/src/main/kotlin/org/fossify/commons/models/contacts/Contact.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ data class Contact(
173173
}
174174
val lastPart = if (startWithSurname) firstMiddle else surname
175175
val suffixComma = if (suffix.isEmpty()) "" else ", $suffix"
176-
val fullName = "$prefix $firstPart $lastPart$suffixComma".trim()
176+
val fullName = listOfNotNull(prefix, firstPart, "$lastPart$suffixComma")
177+
.filter { it.isNotBlank() }
178+
.joinToString(" ")
177179
val organization = getFullCompany()
178180
val email = emails.firstOrNull()?.value?.trim()
179181
val phoneNumber = phoneNumbers.firstOrNull()?.normalizedNumber

0 commit comments

Comments
 (0)