null-guard onScrollListener

Phillip Davis created

turns out that `android.widget.AbsView` calls the listener immediately
after setting it

Change summary

src/main/java/eu/siacs/conversations/ui/ConversationFragment.java | 4 +
1 file changed, 4 insertions(+)

Detailed changes

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;