Added fail-safe

This commit is contained in:
M66B 2022-04-22 08:42:07 +02:00
parent 389f2acfb6
commit fde0e11769
1 changed files with 7 additions and 2 deletions

View File

@ -512,8 +512,13 @@ public class ConnectionHelper {
}
static boolean airplaneMode(Context context) {
return Settings.Global.getInt(context.getContentResolver(),
Settings.Global.AIRPLANE_MODE_ON, 0) != 0;
try {
return (Settings.Global.getInt(context.getContentResolver(),
Settings.Global.AIRPLANE_MODE_ON, 0) != 0);
} catch (Throwable ex) {
Log.e(ex);
return false;
}
}
static InetAddress from6to4(InetAddress addr) {