[Android] Audio browser: Fix IndexOutOfBoundsException

Geoffrey Métais git at videolan.org
Tue Nov 12 17:46:24 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Nov 12 17:40:53 2019 +0100| [a7afe6c673de65fc278d93c7fde0bfbd8065cd2d] | committer: Geoffrey Métais

Audio browser: Fix IndexOutOfBoundsException

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt
index 63677da4c..16bd6981d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt
@@ -173,7 +173,7 @@ class AudioBrowserAdapter @JvmOverloads constructor(
     }
 
     override fun getItem(position: Int): MediaLibraryItem? {
-        return super.getItem(position)
+        return if (position in 0 until itemCount) super.getItem(position) else null
     }
 
     override fun getItemViewType(position: Int): Int {



More information about the Android mailing list