From 4f59b0248b77f9825f81debb49dee421c4b2f29c Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Sun, 2 Jan 2022 00:39:19 -0800 Subject: [PATCH] fix crash when not on network --- .../main/java/de/danoeh/antennapod/core/util/NetworkUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java index 46c1e7f4d..efc7845a4 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java @@ -103,7 +103,8 @@ public class NetworkUtils { NetworkCapabilities capabilities = connManager.getNetworkCapabilities( connManager.getActiveNetwork()); - if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) + if (capabilities != null + && capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) && capabilities.hasTransport(NetworkCapabilities.TRANSPORT_VPN)) { return false; }