Skip to content
Snippets Groups Projects
Commit 07676ab2 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Playlist: Sanity check

(cherry picked from commit 58af3c9e)
parent 9214bc37
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment