mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-04-15 08:50:35 +03:00
Merge branch 'fixCrashes' into 'develop'
Fix a crash See merge request ultrasonic/ultrasonic!874
This commit is contained in:
commit
9c4d83d5f3
@ -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