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