[Android] Browser: Fix NPE

Thomas Guillem git at videolan.org
Fri May 22 12:15:37 CEST 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri May 22 12:14:26 2015 +0200| [482a92d2f0abd94f3881bc0851387f5def580dde] | committer: Thomas Guillem

Browser: Fix NPE

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
index 4fc2772..7c0eb9c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -332,7 +332,8 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
     public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
         ContextMenuRecyclerView.RecyclerContextMenuInfo info = (ContextMenuRecyclerView
                 .RecyclerContextMenuInfo) menuInfo;
-        setContextMenu(getActivity().getMenuInflater(), menu, info.position);
+        if (info != null)
+            setContextMenu(getActivity().getMenuInflater(), menu, info.position);
     }
 
     protected void setContextMenu(MenuInflater inflater, Menu menu, int position) {



More information about the Android mailing list