Fixing NPE in getLengthOfNationalDestinationCode reported in issue 73
authorlararennie@google.com <lararennie@google.com@ee073f10-1060-11df-b6a4-87a95322a99c>
Thu, 10 Nov 2011 14:02:33 +0000 (14:02 +0000)
committerlararennie@google.com <lararennie@google.com@ee073f10-1060-11df-b6a4-87a95322a99c>
Thu, 10 Nov 2011 14:02:33 +0000 (14:02 +0000)
git-svn-id: http://libphonenumber.googlecode.com/svn/trunk@383 ee073f10-1060-11df-b6a4-87a95322a99c

java/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java

index 05f438f..a600334 100644 (file)
@@ -923,7 +923,7 @@ public class PhoneNumberUtil {
       return 0;
     }
 
-    if (getRegionCodeForNumber(number).equals("AR") &&
+    if (getRegionCodeForCountryCode(number.getCountryCode()).equals("AR") &&
         getNumberType(number) == PhoneNumberType.MOBILE) {
       // Argentinian mobile numbers, when formatted in the international format, are in the form of
       // +54 9 NDC XXXX.... As a result, we take the length of the third group (NDC) and add 1 for