[Android] Fix weird NPE

Geoffrey Métais git at videolan.org
Wed Dec 16 18:55:45 CET 2015


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Dec 16 18:54:43 2015 +0100| [590aa335866cf26d4e400f3cb14c9c47ac22813d] | committer: Geoffrey Métais

Fix weird NPE

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index beaae76..042ca68 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -325,6 +325,8 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
 
     @Override
     public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
+        if (menuInfo == null)
+            return;
         // Do not show the menu of media group.
         ContextMenuRecyclerView.RecyclerContextMenuInfo info = (ContextMenuRecyclerView.RecyclerContextMenuInfo)menuInfo;
         MediaWrapper media = mVideoAdapter.getItem(info.position);



More information about the Android mailing list