[Android] Prevent NPE in ExternalMonitor

Geoffrey Métais git at videolan.org
Wed Apr 4 18:35:49 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Mar 22 17:59:20 2018 +0100| [f8eea786e1080b197798a41906a41a19690a8588] | committer: Geoffrey Métais

Prevent NPE in ExternalMonitor

> https://code.videolan.org/videolan/vlc-android/commit/f8eea786e1080b197798a41906a41a19690a8588
---

 vlc-android/src/org/videolan/vlc/ExternalMonitor.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/ExternalMonitor.java b/vlc-android/src/org/videolan/vlc/ExternalMonitor.java
index fafa60f6c..5c16c8ff0 100644
--- a/vlc-android/src/org/videolan/vlc/ExternalMonitor.java
+++ b/vlc-android/src/org/videolan/vlc/ExternalMonitor.java
@@ -168,7 +168,8 @@ public class ExternalMonitor extends BroadcastReceiver implements LifecycleObser
     }
 
     public static boolean isLan() {
-        return connected.getValue() && !mobile;
+        final Boolean status = connected.getValue();
+        return status != null && status && !mobile;
     }
 
     public static boolean isVPN() {



More information about the Android mailing list