[Android] AlbumAdapter: fix NPE
Thomas Guillem
git at videolan.org
Mon Oct 19 09:45:08 CEST 2015
vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Oct 19 09:43:12 2015 +0200| [6d2dd9aa66f784a8fd4a5d014b67f8bea1661e9a] | committer: Thomas Guillem
AlbumAdapter: fix NPE
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=6d2dd9aa66f784a8fd4a5d014b67f8bea1661e9a
---
vlc-android/src/org/videolan/vlc/gui/audio/AlbumAdapter.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AlbumAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/AlbumAdapter.java
index 449780b..9179908 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AlbumAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AlbumAdapter.java
@@ -49,7 +49,8 @@ public class AlbumAdapter extends ArrayAdapter<MediaWrapper> implements IAudioCl
public AlbumAdapter(Context context, ArrayList<MediaWrapper> tracks) {
super(context, 0);
- Collections.sort(tracks, MediaComparators.byTrackNumber);
+ if (tracks != null)
+ Collections.sort(tracks, MediaComparators.byTrackNumber);
mMediaList = tracks;
}
More information about the Android
mailing list