[Android] Ensure non nullity

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


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu May  7 15:42:27 2015 +0200| [af64a97f75e029887a24e10c005671c8fccfe6de] | committer: Geoffrey Métais

Ensure non nullity

CID #1297144

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

 .../src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java        |    2 +-
 1 file changed, 1 insertion(+), 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 686f837..c0568e3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -346,7 +346,7 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
             inflater.inflate(R.menu.directory_view_file, menu);
             menu.findItem(R.id.directory_view_delete).setVisible(canWrite);
         } else if (mw.getType() == MediaWrapper.TYPE_DIR) {
-            boolean isEmpty = mMediaLists.get(position).isEmpty();
+            boolean isEmpty = mMediaLists.get(position) == null || mMediaLists.get(position).isEmpty();
             if (canWrite || !isEmpty) {
                 inflater.inflate(R.menu.directory_view_dir, menu);
                 if (canWrite) {



More information about the Android mailing list