[Android] Prevent NPE

Geoffrey Métais git at videolan.org
Mon May 22 15:29:51 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon May 22 15:29:28 2017 +0200| [8bca84624eca5a1b6812d8c023f4c0f9bba0ce28] | committer: Geoffrey Métais

Prevent NPE

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index c933bf4..e97f68c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1632,6 +1632,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
                     if (event.getEsChangedType() == Media.Track.Type.Audio) {
                         MediaWrapper media = mMedialibrary.findMedia(mService.getCurrentMediaWrapper());
                         setESTrackLists();
+                        if (media == null)
+                            return;
                         int audioTrack = (int) media.getMetaLong(mMedialibrary, MediaWrapper.META_AUDIOTRACK);
                         if (audioTrack != 0 || mCurrentAudioTrack != -2)
                             mService.setAudioTrack(media.getId() == 0L ? mCurrentAudioTrack : audioTrack);



More information about the Android mailing list