fix crash on unknown notification (#4546)

```
Exception java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setClipToOutline(boolean)' on a null object reference
  at com.keylesspalace.tusky.adapter.StatusBaseViewHolder.<init> (StatusBaseViewHolder.java:150)
  at com.keylesspalace.tusky.adapter.StatusViewHolder.<init> (StatusViewHolder.java:55)
  at com.keylesspalace.tusky.components.notifications.UnknownNotificationViewHolder.<init> (UnknownNotificationViewHolder.java:27)
  at com.keylesspalace.tusky.components.notifications.NotificationsPagingAdapter.onCreateViewHolder (NotificationsPagingAdapter.kt:139)
  at androidx.recyclerview.widget.RecyclerView$Adapter.createViewHolder (RecyclerView.java:7788)
  at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline (RecyclerView.java:6873)
  at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition (RecyclerView.java:6757)
  at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition (RecyclerView.java:6753)
  at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next (LinearLayoutManager.java:2362)
  at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk (LinearLayoutManager.java:1662)
  at androidx.recyclerview.widget.LinearLayoutManager.fill (LinearLayoutManager.java:1622)
  at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren (LinearLayoutManager.java:687)
  at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2 (RecyclerView.java:4645)
  at androidx.recyclerview.widget.RecyclerView.dispatchLayout (RecyclerView.java:4348)
  at androidx.recyclerview.widget.RecyclerView.onLayout (RecyclerView.java:4919)
  ...
```
This commit is contained in:
Konrad Pozniak 2024-07-07 19:50:50 +02:00 committed by GitHub
parent d013dc05ba
commit 9533b90bcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -17,14 +17,14 @@
package com.keylesspalace.tusky.components.notifications package com.keylesspalace.tusky.components.notifications
import com.keylesspalace.tusky.adapter.StatusViewHolder import androidx.recyclerview.widget.RecyclerView
import com.keylesspalace.tusky.databinding.ItemUnknownNotificationBinding import com.keylesspalace.tusky.databinding.ItemUnknownNotificationBinding
import com.keylesspalace.tusky.util.StatusDisplayOptions import com.keylesspalace.tusky.util.StatusDisplayOptions
import com.keylesspalace.tusky.viewdata.NotificationViewData import com.keylesspalace.tusky.viewdata.NotificationViewData
internal class UnknownNotificationViewHolder( internal class UnknownNotificationViewHolder(
binding: ItemUnknownNotificationBinding, binding: ItemUnknownNotificationBinding,
) : NotificationsViewHolder, StatusViewHolder(binding.root) { ) : NotificationsViewHolder, RecyclerView.ViewHolder(binding.root) {
override fun bind( override fun bind(
viewData: NotificationViewData.Concrete, viewData: NotificationViewData.Concrete,