[Android] Prevent NPE in context menu creation

Geoffrey Métais git at videolan.org
Thu May 7 16:29:24 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu May  7 11:58:18 2015 +0200| [c8687687b710039f2645e321b24bff1aad5eeaf3] | committer: Geoffrey Métais

Prevent NPE in context menu creation

CID #1297079

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=c8687687b710039f2645e321b24bff1aad5eeaf3
---

 .../src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java     |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
index 75bf35a..7ccf122 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
@@ -219,6 +219,8 @@ public class AudioAlbumsSongsFragment extends Fragment implements SwipeRefreshLa
 
     private boolean handleContextItemSelected(MenuItem item, int position) {
         ContextMenuInfo menuInfo = item.getMenuInfo();
+        if (menuInfo == null)
+            return false;
 
         int startPosition;
         int groupPosition;



More information about the Android mailing list