From fde0e1176919c3b8e15d066f1e335a8731447a1a Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 22 Apr 2022 08:42:07 +0200 Subject: [PATCH] Added fail-safe --- .../main/java/eu/faircode/email/ConnectionHelper.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ConnectionHelper.java b/app/src/main/java/eu/faircode/email/ConnectionHelper.java index 9728748d07..b56703cc22 100644 --- a/app/src/main/java/eu/faircode/email/ConnectionHelper.java +++ b/app/src/main/java/eu/faircode/email/ConnectionHelper.java @@ -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) {