[Android] Fix potential IndexOutOfBoundsException
Geoffrey Métais
git at videolan.org
Wed Dec 2 16:38:42 CET 2015
vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Dec 2 16:14:46 2015 +0100| [f8d7c21d1e17d16e3e77e4910242923f14e541ab] | committer: Geoffrey Métais
Fix potential IndexOutOfBoundsException
(cherry picked from commit 41139e8386c349005acc69611a88d59994a32b24)
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=f8d7c21d1e17d16e3e77e4910242923f14e541ab
---
.../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index 46cc56d..f21b940 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -322,6 +322,8 @@ public class AudioBrowserFragment extends MediaBrowserFragment implements SwipeR
@Override
public void onItemClick(AdapterView<?> av, View v, int p, long id) {
ArrayList<MediaWrapper> mediaList = mArtistsAdapter.getMedias(p);
+ if (mediaList.isEmpty())
+ return;
MainActivity activity = (MainActivity)getActivity();
Intent i = new Intent(getActivity(), SecondaryActivity.class);
i.putExtra("fragment", "albumsSongs");
@@ -335,6 +337,8 @@ public class AudioBrowserFragment extends MediaBrowserFragment implements SwipeR
@Override
public void onItemClick(AdapterView<?> av, View v, int p, long id) {
ArrayList<MediaWrapper> mediaList = mAlbumsAdapter.getMedias(p);
+ if (mediaList.isEmpty())
+ return;
Intent i = new Intent(getActivity(), SecondaryActivity.class);
i.putExtra("fragment", SecondaryActivity.ALBUM);
i.putParcelableArrayListExtra("list", mediaList);
@@ -347,6 +351,8 @@ public class AudioBrowserFragment extends MediaBrowserFragment implements SwipeR
@Override
public void onItemClick(AdapterView<?> av, View v, int p, long id) {
ArrayList<MediaWrapper> mediaList = mGenresAdapter.getMedias(p);
+ if (mediaList.isEmpty())
+ return;
Intent i = new Intent(getActivity(), SecondaryActivity.class);
i.putExtra("fragment", SecondaryActivity.ALBUMS_SONGS);
i.putParcelableArrayListExtra("list", mediaList);
More information about the Android
mailing list