mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-04-15 17:00:36 +03:00
Fix a crash
This commit is contained in:
parent
2b416c9796
commit
ebb1dc0eed
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user