mirror of
https://github.com/M66B/NetGuard.git
synced 2025-02-22 22:31:17 +00:00
Prevent crash
This commit is contained in:
parent
3c7a91d3e0
commit
7d80aaf61d
1 changed files with 6 additions and 2 deletions
|
@ -165,8 +165,12 @@ public class Util {
|
|||
}
|
||||
|
||||
public static boolean isInternational(Context context) {
|
||||
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
return (tm != null && tm.getSimCountryIso() != null && !tm.getSimCountryIso().equals(tm.getNetworkCountryIso()));
|
||||
try {
|
||||
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
return (tm != null && tm.getSimCountryIso() != null && !tm.getSimCountryIso().equals(tm.getNetworkCountryIso()));
|
||||
} catch (Throwable ignored) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getNetworkGeneration(int networkType) {
|
||||
|
|
Loading…
Reference in a new issue