[Android] Playlist: Sanity check
Geoffrey Métais
git at videolan.org
Fri Apr 12 13:23:38 CEST 2019
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Apr 12 13:23:17 2019 +0200| [58af3c9e291d4f3371d055673c62af5a4f5f541d] | committer: Geoffrey Métais
Playlist: Sanity check
> https://code.videolan.org/videolan/vlc-android/commit/58af3c9e291d4f3371d055673c62af5a4f5f541d
---
vlc-android/src/org/videolan/vlc/viewmodels/PlaylistModel.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/viewmodels/PlaylistModel.kt b/vlc-android/src/org/videolan/vlc/viewmodels/PlaylistModel.kt
index 1da132df9..b003ffda0 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/PlaylistModel.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/PlaylistModel.kt
@@ -105,7 +105,7 @@ class PlaylistModel : ScopedModel(), PlaybackService.Callback by EmptyPBSCallbac
fun getPlaylistPosition(position: Int, media: MediaWrapper): Int {
val list = originalDataset ?: dataset.value
- if (list[position] == media) return position
+ if (position in 0 until list.size && list[position] == media) return position
else {
for ((index, item) in list.withIndex()) if (item == media) {
return index
More information about the Android
mailing list