commit | 04dfb5ec3cb9f5a1dac737b429919a3e82768aab | [log] [tgz] |
---|---|---|
author | Santos Cordon <santoscordon@google.com> | Tue Aug 27 16:45:37 2013 -0700 |
committer | Santos Cordon <santoscordon@google.com> | Tue Aug 27 16:45:37 2013 -0700 |
tree | 6effc029f8ad176f53d5489f50578c303e316f33 | |
parent | 94366313331a789440a3c077173aafcb85cabe78 [diff] |
Protecting against NPE with null country detector. bug:10514454 Change-Id: I316c47eddbe4929599866a3f9da9129d0056e3e2
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java index 3ae2106..ab429fd 100644 --- a/telephony/java/android/telephony/PhoneNumberUtils.java +++ b/telephony/java/android/telephony/PhoneNumberUtils.java
@@ -1805,7 +1805,7 @@ String countryIso; CountryDetector detector = (CountryDetector) context.getSystemService( Context.COUNTRY_DETECTOR); - if (detector != null) { + if (detector != null && detector.detectCountry() != null) { countryIso = detector.detectCountry().getCountryIso(); } else { Locale locale = context.getResources().getConfiguration().locale;