mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-04-18 18:17:43 +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 (currentIndex < 0 || currentIndex >= playlist.size) return
|
||||||
if (newIndex < 0 || newIndex >= 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)
|
val item = playlist.removeAt(currentIndex)
|
||||||
playlist.add(insertIndex, item)
|
playlist.add(insertIndex, item)
|
||||||
updatePlaylist()
|
updatePlaylist()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user