Merge pull request #3718 from jatzuk/fix_channel_fragment_npe

ChannelFragment NPE fix
This commit is contained in:
Bnyro 2023-05-05 17:37:06 +02:00 committed by GitHub
commit f4fdfc5c99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,8 +137,9 @@ class ChannelFragment : Fragment() {
fetchChannelNextPage() fetchChannelNextPage()
} }
val channelId = channelId ?: return@repeatOnLifecycle
// fetch and update the subscription status // fetch and update the subscription status
isSubscribed = SubscriptionHelper.isSubscribed(channelId!!) isSubscribed = SubscriptionHelper.isSubscribed(channelId)
if (isSubscribed == null) return@repeatOnLifecycle if (isSubscribed == null) return@repeatOnLifecycle
binding.channelSubscribe.setupSubscriptionButton( binding.channelSubscribe.setupSubscriptionButton(
@ -149,7 +150,7 @@ class ChannelFragment : Fragment() {
binding.channelShare.setOnClickListener { binding.channelShare.setOnClickListener {
val shareDialog = ShareDialog( val shareDialog = ShareDialog(
response.id!!.toID(), channelId.toID(),
ShareObjectType.CHANNEL, ShareObjectType.CHANNEL,
shareData shareData
) )