Fix a crash

This commit is contained in:
tzugen 2022-11-14 09:45:34 +01:00
parent 2b416c9796
commit ebb1dc0eed
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930

View File

@ -384,7 +384,7 @@ class JukeboxMediaPlayer : JukeboxUnimplementedFunctions(), Player {
if (currentIndex < 0 || currentIndex >= playlist.size) return
if (newIndex < 0 || newIndex >= playlist.size) return
val insertIndex = if (newIndex < currentIndex) newIndex else newIndex - 1
val insertIndex = if (newIndex < currentIndex) newIndex else (newIndex - 1).coerceAtLeast(0)
val item = playlist.removeAt(currentIndex)
playlist.add(insertIndex, item)
updatePlaylist()