[Android] Prevent exception when audio list is empty

Geoffrey Métais git at videolan.org
Mon Jan 16 17:19:19 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jan 16 16:19:20 2017 +0100| [39ab9d6b2c95cf3e88f90b8a0edf6f3c3c338c0b] | committer: Geoffrey Métais

Prevent exception when audio list is empty

> https://code.videolan.org/videolan/vlc-android/commit/39ab9d6b2c95cf3e88f90b8a0edf6f3c3c338c0b
---

 vlc-android/src/org/videolan/vlc/gui/tv/browser/MusicFragment.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 e967ff3..2e664bd 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
@@ -169,7 +169,7 @@ public class MusicFragment extends MediaLibBrowserFragment implements OnItemView
 
         protected void onProgressUpdate(MediaLibraryItem[]... datalist){
             List<Object> list = Arrays.asList(((Object[]) datalist[0]));
-            if (TextUtils.isEmpty(((MediaLibraryItem)list.get(0)).getTitle()) && list.size() > 1)
+            if (list.size() > 1 && TextUtils.isEmpty(((MediaLibraryItem)list.get(0)).getTitle()))
                 list = list.subList(1, list.size());
             mAdapter.addAll(0, list);
         }



More information about the Android mailing list