From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: alina sireneva <alina@tei.pet>
Date: Sun, 26 Jul 2026 17:23:13 +0400
Subject: Avoid crash when recycling stale RecyclerView children

---
 .../main/java/androidx/recyclerview/widget/RecyclerView.java  | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/TMessagesProj/src/main/java/androidx/recyclerview/widget/RecyclerView.java b/TMessagesProj/src/main/java/androidx/recyclerview/widget/RecyclerView.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/androidx/recyclerview/widget/RecyclerView.java
+++ b/TMessagesProj/src/main/java/androidx/recyclerview/widget/RecyclerView.java
@@ -8914,6 +8914,10 @@ public class RecyclerView extends ViewGroup implements ScrollingView,
         public void removeAndRecycleViewAt(int index, @NonNull Recycler recycler) {
             final View view = getChildAt(index);
             ViewHolder holder = getChildViewHolderInt(view);
+            if (holder == null) {
+                removeViewAt(index);
+                return;
+            }
             if (holder.shouldIgnore()) {
                 return;
             }
