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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user