[Android] Prevent ArrayIndexOutOfBoundsException
Nicolas Pomepuy
git at videolan.org
Tue Oct 6 10:58:46 CEST 2020
vlc-android | branch: 3.3.x | Nicolas Pomepuy <nicolas at videolabs.io> | Fri Sep 25 08:06:48 2020 +0200| [39beba648129f8de0b39f601e93588c43a0692fc] | committer: Nicolas Pomepuy
Prevent ArrayIndexOutOfBoundsException
(cherry picked from commit f2c78660f24deb14648f80cb0dc87cce9a528ff7)
> https://code.videolan.org/videolan/vlc-android/commit/39beba648129f8de0b39f601e93588c43a0692fc
---
.../src/org/videolan/vlc/viewmodels/mobile/AudioBrowserViewModel.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/viewmodels/mobile/AudioBrowserViewModel.kt b/application/vlc-android/src/org/videolan/vlc/viewmodels/mobile/AudioBrowserViewModel.kt
index f00a1ee6f..4e2e71226 100644
--- a/application/vlc-android/src/org/videolan/vlc/viewmodels/mobile/AudioBrowserViewModel.kt
+++ b/application/vlc-android/src/org/videolan/vlc/viewmodels/mobile/AudioBrowserViewModel.kt
@@ -70,7 +70,7 @@ class AudioBrowserViewModel(context: Context) : MedialibraryViewModel(context) {
override fun refresh() {
artistsProvider.showAll = settings.getBoolean(KEY_ARTISTS_SHOW_ALL, false)
viewModelScope.launch {
- providers[currentTab].awaitRefresh()
+ if (currentTab < providers.size) providers[currentTab].awaitRefresh()
for ((index, provider) in providers.withIndex()) {
if (index != currentTab && provider.loading.hasObservers()) provider.awaitRefresh()
}
More information about the Android
mailing list