From 9533b90bcd714cac79c452cd5b33d38db95fd2dd Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Sun, 7 Jul 2024 19:50:50 +0200 Subject: [PATCH] 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. (StatusBaseViewHolder.java:150) at com.keylesspalace.tusky.adapter.StatusViewHolder. (StatusViewHolder.java:55) at com.keylesspalace.tusky.components.notifications.UnknownNotificationViewHolder. (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) ... ``` --- .../components/notifications/UnknownNotificationViewHolder.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/components/notifications/UnknownNotificationViewHolder.kt b/app/src/main/java/com/keylesspalace/tusky/components/notifications/UnknownNotificationViewHolder.kt index 3ccc2f2af..b4bfcf8b1 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/notifications/UnknownNotificationViewHolder.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/notifications/UnknownNotificationViewHolder.kt @@ -17,14 +17,14 @@ 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.util.StatusDisplayOptions import com.keylesspalace.tusky.viewdata.NotificationViewData internal class UnknownNotificationViewHolder( binding: ItemUnknownNotificationBinding, -) : NotificationsViewHolder, StatusViewHolder(binding.root) { +) : NotificationsViewHolder, RecyclerView.ViewHolder(binding.root) { override fun bind( viewData: NotificationViewData.Concrete,