From f9eb2c506bc9d2d27916fe649f319b3aa73c6797 Mon Sep 17 00:00:00 2001 From: Phillip Davis Date: Wed, 22 Apr 2026 14:44:24 -0400 Subject: [PATCH] null-guard onScrollListener turns out that `android.widget.AbsView` calls the listener immediately after setting it --- .../java/eu/siacs/conversations/ui/ConversationFragment.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index f9e5bfe005adae4d8fd3149c6e99acdfb7d2698a..1a21bb6e5a41e5c105fb7e1db39e9e5bb8fe4c60 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -372,6 +372,10 @@ public class ConversationFragment extends XmppFragment int visibleItemCount, int totalItemCount) { toggleScrollDownButton(view); + final Conversation conversation = ConversationFragment.this.conversation; + if (conversation == null) { + return; + } synchronized (ConversationFragment.this.messageList) { boolean paginateBackward = firstVisibleItem < 5; boolean paginationForward = conversation.isInHistoryPart() && firstVisibleItem + visibleItemCount + 5 > totalItemCount;