[Android] Prevent NPE

Geoffrey Métais git at videolan.org
Wed May 10 18:06:56 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed May 10 18:06:43 2017 +0200| [00c00cf5ee202de3fe0ae94268b3f27962ac6285] | committer: Geoffrey Métais

Prevent NPE

> https://code.videolan.org/videolan/vlc-android/commit/00c00cf5ee202de3fe0ae94268b3f27962ac6285
---

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java
index bd8bcc4..ad5e5a3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java
@@ -418,7 +418,8 @@ public class AudioBrowserAdapter extends BaseQueuedAdapter<MediaLibraryItem[], A
 
         @Override
         protected void publishResults(CharSequence charSequence, FilterResults filterResults) {
-            update(((ArrayList<MediaLibraryItem>) filterResults.values).toArray(new MediaLibraryItem[filterResults.count]));
+            update(filterResults.values == null ? new MediaLibraryItem[0]
+                    : ((ArrayList<MediaLibraryItem>) filterResults.values).toArray(new MediaLibraryItem[filterResults.count]));
         }
     }
 }



More information about the Android mailing list