[Android] Prevent IndexOutOfBoundsException
Geoffrey Métais
git at videolan.org
Wed Jun 22 12:03:18 CEST 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jun 22 11:16:18 2016 +0200| [4c29c96b6727bc6b2a30757db807ca666947ba6e] | committer: Geoffrey Métais
Prevent IndexOutOfBoundsException
> https://code.videolan.org/videolan/vlc-android/commit/4c29c96b6727bc6b2a30757db807ca666947ba6e
---
.../src/org/videolan/vlc/gui/tv/browser/MusicFragment.java | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/MusicFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/browser/MusicFragment.java
index cd99d5a..40566a0 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/MusicFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/MusicFragment.java
@@ -148,11 +148,14 @@ public class MusicFragment extends MediaLibBrowserFragment {
}
}
//Customize title for artist/genre browsing
- if (mType == FILTER_ARTIST){
- title = title + " " + mMediaItemList.get(0).mediaList.get(0).getArtist();
- } else if (mType == FILTER_GENRE){
- title = title + " " + mMediaItemList.get(0).mediaList.get(0).getGenre();
- }
+ if (!mMediaItemList.isEmpty()) {
+ if (mType == FILTER_ARTIST){
+ title = title + " " + mMediaItemList.get(0).mediaList.get(0).getArtist();
+ } else if (mType == FILTER_GENRE){
+ title = title + " " + mMediaItemList.get(0).mediaList.get(0).getGenre();
+ }
+ } else
+ title = getString(R.string.app_name_full);
} else if (CATEGORY_GENRES == mCategory){
title = getString(R.string.genres);
Collections.sort(audioList, MediaComparators.byGenre);
More information about the Android
mailing list