[Android] Prevent NPE

Geoffrey Métais git at videolan.org
Tue Dec 20 16:03:57 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Dec 20 15:49:46 2016 +0100| [d051dc4abd81c3c0a806c9860e696b3775ecb58e] | committer: Geoffrey Métais

Prevent NPE

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java b/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java
index 4bdd961..c6cb5c3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java
@@ -400,7 +400,8 @@ public class AudioPlayerContainerActivity extends AppCompatActivity implements P
 
     @Override
     public void onDisconnected() {
-        mService.removeCallback(this);
+        if (mService != null)
+            mService.removeCallback(this);
         mService = null;
     }
 }



More information about the Android mailing list