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

Playlist: Sanity check

parent 4229ea2c
No related branches found
No related tags found
No related merge requests found
Pipeline #6216 passed with stage
in 4 minutes and 4 seconds
......@@ -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