Skip to content

Commit 97ecea6

Browse files
authored
update phonenumberutil.js file
1 parent 822a091 commit 97ecea6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

javascript/i18n/phonenumbers/phonenumberutil.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1790,7 +1790,7 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.format =
17901790
if (rawInput.length > 0 && number.hasCountryCode()
17911791
&& number.getCountryCodeSource() == i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_DEFAULT_COUNTRY
17921792
&& numberFormat == i18n.phonenumbers.PhoneNumberFormat.E164) {
1793-
const countryCallingCode = number.getCountryCode();
1793+
const countryCallingCode = number.getCountryCodeOrDefault();
17941794
let formattedNumber =rawInput;
17951795
return this.prefixNumberWithCountryCallingCode_(countryCallingCode, numberFormat, formattedNumber,'');
17961796
} else if (rawInput.length > 0 || !number.hasCountryCode()) {

0 commit comments

Comments
 (0)