diff --git a/src/frontend/plugins/mail-editor/mail-editor.component.ts b/src/frontend/plugins/mail-editor/mail-editor.component.ts index 5df8b70e6a61ac5a9dd750751a667acf928ea580..e900b08b275d874b72ee12d66074563eb7e0c8c9 100644 --- a/src/frontend/plugins/mail-editor/mail-editor.component.ts +++ b/src/frontend/plugins/mail-editor/mail-editor.component.ts @@ -636,8 +636,12 @@ export class MailEditorComponent implements OnInit, OnDestroy { data = data.filter((contact: any) => !this.functions.empty(contact.email) || contact.type === 'contactGroup').map((contact: any) => { let label: string; if (contact.type === 'user' || contact.type === 'contact') { - if (!this.functions.empty(contact.firstname) || !this.functions.empty(contact.lastname)) { - label = contact.firstname + ' ' + contact.lastname; + if (!this.functions.empty(contact.firstname) && !this.functions.empty(contact.lastname)) { + label = `${contact.firstname} ${contact.lastname}`; + } else if (this.functions.empty(contact.firstname) && !this.functions.empty(contact.lastname)) { + label = contact.lastname; + } else if (!this.functions.empty(contact.firstname) && this.functions.empty(contact.lastname)) { + label = contact.firstname; } else { label = contact.company; }