[Android] Audio browser: Fix IndexOutOfBoundsException

Geoffrey Métais git at videolan.org
Wed Nov 13 10:29:21 CET 2019


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

Audio browser: Fix IndexOutOfBoundsException

(cherry picked from commit a7afe6c673de65fc278d93c7fde0bfbd8065cd2d)

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

 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