diff --git a/UI/WebServerResources/js/Mailer/Message.service.js b/UI/WebServerResources/js/Mailer/Message.service.js index 717a29622..cf02869b1 100644 --- a/UI/WebServerResources/js/Mailer/Message.service.js +++ b/UI/WebServerResources/js/Mailer/Message.service.js @@ -275,8 +275,22 @@ */ Message.prototype.$shortAddress = function(type) { var address = ''; - if (this[type] && this[type].length > 0) { - address = this[type][0].name || this[type][0].email || ''; + if (this[type]) { + if (angular.isString(this[type])) { + // The recipient is a string; try to extract the name + var emailRE = / 0) { + // We have an array of objects; pick the first one + address = this[type][0].name || this[type][0].email || ''; + } } return address;