From fa149d22af2217335ea470221c0eab6edf71c6b0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 27 Jun 2017 09:37:20 +0200 Subject: [PATCH] fix(LinphoneUtils): check correctly sip address string in getContactUsername --- ui/scripts/LinphoneUtils/linphone-utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/scripts/LinphoneUtils/linphone-utils.js b/ui/scripts/LinphoneUtils/linphone-utils.js index 4d1651978..8dff828fc 100644 --- a/ui/scripts/LinphoneUtils/linphone-utils.js +++ b/ui/scripts/LinphoneUtils/linphone-utils.js @@ -17,7 +17,10 @@ function getContactUsername (contact) { return object.vcard.username } - object = contact.sipAddress || contact // String from `SipAddressObserver` or just a String. + object = Utils.isString(contact.sipAddress) + ? contact.sipAddress // String from `SipAddressObserver`. + : contact // Just a String. + var index = object.indexOf('@') return object.substring(4, index !== -1 ? index : undefined) // 4 = length('sip:') }