From 193d497d664d3b281f41aef358ade34e306e1d5a Mon Sep 17 00:00:00 2001 From: Ersun Warncke Date: Tue, 26 Jun 2018 07:50:31 -0400 Subject: [PATCH] fix undefined last name --- .../app/coffee/Features/Contacts/ContactController.coffee | 6 +++--- .../share/controllers/ShareProjectModalController.coffee | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/web/app/coffee/Features/Contacts/ContactController.coffee b/services/web/app/coffee/Features/Contacts/ContactController.coffee index b3c2f7d02b..c2df6cc989 100644 --- a/services/web/app/coffee/Features/Contacts/ContactController.coffee +++ b/services/web/app/coffee/Features/Contacts/ContactController.coffee @@ -35,8 +35,8 @@ module.exports = ContactsController = _formatContact: (contact) -> return { id: contact._id?.toString() - email: contact.email - first_name: contact.first_name - last_name: contact.last_name + email: contact.email || "" + first_name: contact.first_name || "" + last_name: contact.last_name || "" type: "user" } diff --git a/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee b/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee index b64fef64bb..13961e9774 100644 --- a/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee +++ b/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee @@ -39,7 +39,7 @@ define [ $scope.autocompleteContacts = data.contacts or [] for contact in $scope.autocompleteContacts if contact.type == "user" - if contact.last_name == "" and contact.first_name == contact.email.split("@")[0] + if contact.first_name == contact.email.split("@")[0] and !contact.last_name # User has not set their proper name so use email as canonical display property contact.display = contact.email else