[Android] Prevent NPE

Geoffrey Métais git at videolan.org
Mon Feb 27 11:39:38 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 27 09:44:27 2017 +0100| [4b61e135b47350d621f20a16c669b0bd013cdd07] | committer: Geoffrey Métais

Prevent NPE

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
index 9d26c5e..2d3d28c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
@@ -190,7 +190,8 @@ public class MainTvActivity extends BaseTvActivity implements OnItemViewSelected
 
     @Override
     public void onDisconnected() {
-        mService.removeCallback(this);
+        if (mService != null)
+            mService.removeCallback(this);
         super.onDisconnected();
     }
 



More information about the Android mailing list