mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
Merge pull request #5382 from Bnyro/master
fix: crash when playing deleted playlist in background
This commit is contained in:
commit
ac02961cb6
@ -68,8 +68,12 @@ class PlaylistOptionsBottomSheet : BaseBottomSheet() {
|
||||
// play the playlist in the background
|
||||
R.string.playOnBackground -> {
|
||||
val playlist = withContext(Dispatchers.IO) {
|
||||
PlaylistsHelper.getPlaylist(playlistId)
|
||||
runCatching { PlaylistsHelper.getPlaylist(playlistId) }
|
||||
}.getOrElse {
|
||||
context?.toastFromMainDispatcher(R.string.error)
|
||||
return@setSimpleItems
|
||||
}
|
||||
|
||||
playlist.relatedStreams.firstOrNull()?.let {
|
||||
BackgroundHelper.playOnBackground(
|
||||
requireContext(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user