From 4ef8b9334452a1a5968bd04c80680fdc7fe9812d Mon Sep 17 00:00:00 2001 From: kapodamy Date: Sat, 28 Jul 2018 12:07:10 -0300 Subject: [PATCH] patch for ListHelper.java double check for null --- app/src/main/java/org/schabi/newpipe/util/ListHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/util/ListHelper.java b/app/src/main/java/org/schabi/newpipe/util/ListHelper.java index 4f607b581..1a5bf14f7 100644 --- a/app/src/main/java/org/schabi/newpipe/util/ListHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/ListHelper.java @@ -443,11 +443,11 @@ public final class ListHelper { /** * Are we connected to wifi? * @param context App context - * @return True if connected to wifi + * @return {@code true} if connected to wifi */ private static boolean isWifiActive(Context context) { ConnectivityManager manager = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); - return manager.getActiveNetworkInfo().getType() == ConnectivityManager.TYPE_WIFI; + return manager != null && manager.getActiveNetworkInfo() != null && manager.getActiveNetworkInfo().getType() == ConnectivityManager.TYPE_WIFI; } }