diff --git a/js/models/conversations.js b/js/models/conversations.js index 3dc8b8e3..a7c7039e 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -47,15 +47,18 @@ // hack if (this.get('type') === 'private') { - this.id = libphonenumber.util.verifyNumber(this.id); - var number = libphonenumber.util.splitCountryCode(this.id); - - this.set({ - e164_number: this.id, - national_number: '' + number.national_number, - international_number: '' + number.country_code + number.national_number - }); + try { + this.id = libphonenumber.util.verifyNumber(this.id); + var number = libphonenumber.util.splitCountryCode(this.id); + this.set({ + e164_number: this.id, + national_number: '' + number.national_number, + international_number: '' + number.country_code + number.national_number + }); + } catch(ex) { + return ex; + } } },