Fix crash when a channel doesn't have a description

This commit is contained in:
Bnyro 2023-04-15 19:24:48 +02:00
parent 451320b7de
commit 2b446d5b0f
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ data class Channel(
val name: String? = null, val name: String? = null,
val avatarUrl: String? = null, val avatarUrl: String? = null,
val bannerUrl: String? = null, val bannerUrl: String? = null,
val description: String = "", val description: String? = null,
val nextpage: String? = null, val nextpage: String? = null,
val subscriberCount: Long = 0, val subscriberCount: Long = 0,
val verified: Boolean = false, val verified: Boolean = false,

View File

@ -172,10 +172,10 @@ class ChannelFragment : Fragment() {
R.string.subscribers, R.string.subscribers,
response.subscriberCount.formatShort() response.subscriberCount.formatShort()
) )
if (response.description.isBlank()) { if (response.description.orEmpty().isBlank()) {
binding.channelDescription.visibility = View.GONE binding.channelDescription.visibility = View.GONE
} else { } else {
binding.channelDescription.text = response.description.trim() binding.channelDescription.text = response.description.orEmpty().trim()
} }
binding.channelDescription.setOnClickListener { binding.channelDescription.setOnClickListener {