Merge pull request #1896 from Bnyro/master

fix playlists crash
This commit is contained in:
Bnyro 2022-11-18 16:28:16 +01:00 committed by GitHub
commit 423d6f808e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,11 +95,12 @@ class PlaylistFragment : BaseFragment() {
binding.playlistName.maxLines = if (binding.playlistName.maxLines == 2) Int.MAX_VALUE else 2 binding.playlistName.maxLines = if (binding.playlistName.maxLines == 2) Int.MAX_VALUE else 2
} }
binding.playlistInfo.text = response.uploader + TextUtils.SEPARATOR + getString(R.string.videoCount, response.videos.toString()) binding.playlistInfo.text = (if (response.uploader != null) response.uploader + TextUtils.SEPARATOR else "") +
getString(R.string.videoCount, response.videos.toString())
// show playlist options // show playlist options
binding.optionsMenu.setOnClickListener { binding.optionsMenu.setOnClickListener {
PlaylistOptionsBottomSheet(playlistId!!, playlistName!!, isOwner).show( PlaylistOptionsBottomSheet(playlistId!!, playlistName ?: "", isOwner).show(
childFragmentManager, childFragmentManager,
PlaylistOptionsBottomSheet::class.java.name PlaylistOptionsBottomSheet::class.java.name
) )