am b56ed3a4: Merge "Protecting against NPE with null country detector." into klp-dev

* commit 'b56ed3a4b2ad168b58356173e539f8112d351283':
  Protecting against NPE with null country detector.
This commit is contained in:
Santos Cordon
2013-08-28 10:49:41 -07:00
committed by Android Git Automerger

View File

@@ -1805,7 +1805,7 @@ public class PhoneNumberUtils
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;