[Android] Prevent NPE in subs picker

Geoffrey Métais git at videolan.org
Tue Nov 21 11:23:30 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Nov 21 11:14:06 2017 +0100| [42d48603a28dbd1d9a9e156c6f3e147aae3c3813] | committer: Geoffrey Métais

Prevent NPE in subs picker

> https://code.videolan.org/videolan/vlc-android/commit/42d48603a28dbd1d9a9e156c6f3e147aae3c3813
---

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.java b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.java
index 3b98dbec1..857ab28fd 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.java
@@ -211,7 +211,8 @@ public class BaseBrowserAdapter extends SortableAdapter<MediaLibraryItem, BaseBr
 
         @Override
         protected boolean isSelected() {
-            return getItem(getLayoutPosition()).hasStateFlags(FLAG_SELECTED);
+            final MediaLibraryItem item = getItem(getLayoutPosition());
+            return item != null && item.hasStateFlags(FLAG_SELECTED);
         }
     }
 



More information about the Android mailing list