diff --git a/app/src/main/java/eu/faircode/netguard/Util.java b/app/src/main/java/eu/faircode/netguard/Util.java index de188398..5b4eef95 100644 --- a/app/src/main/java/eu/faircode/netguard/Util.java +++ b/app/src/main/java/eu/faircode/netguard/Util.java @@ -160,7 +160,7 @@ public class Util { public static boolean isNetworkActive(Context context) { ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); - return (cm == null ? false : cm.getActiveNetworkInfo() != null); + return (cm != null && cm.getActiveNetworkInfo() != null); } public static boolean isConnected(Context context) {