mirror of
https://github.com/videolan/vlc-android
synced 2024-11-23 18:05:36 +08:00
Prevent crash when shuffling an empty playlist
This commit is contained in:
parent
f499b02e3d
commit
6ea4fafd0f
@ -169,7 +169,7 @@ open class HeaderMediaListActivity : AudioPlayerContainerActivity(), IEventsHand
|
||||
|
||||
}
|
||||
binding.btnShuffle.setOnClickListener {
|
||||
viewModel.playlist?.let { MediaUtils.playTracks(this, it, SecureRandom().nextInt(min(playlist.tracksCount, MEDIALIBRARY_PAGE_SIZE)), true) }
|
||||
viewModel.playlist?.let { if (it.tracksCount > 0) MediaUtils.playTracks(this, it, SecureRandom().nextInt(min(playlist.tracksCount, MEDIALIBRARY_PAGE_SIZE)), true) }
|
||||
}
|
||||
binding.btnAddPlaylist.setOnClickListener {
|
||||
viewModel.playlist?.let { addToPlaylist(it.tracks.toList()) }
|
||||
|
Loading…
Reference in New Issue
Block a user