From 237040b1bef6f0ee3d589952c1f78b8438245390 Mon Sep 17 00:00:00 2001 From: imndx Date: Sun, 22 Dec 2024 09:01:15 +0800 Subject: [PATCH] fix npe --- .../chat/kit/conversationlist/ConversationListFragment.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/uikit/src/main/java/cn/wildfire/chat/kit/conversationlist/ConversationListFragment.java b/uikit/src/main/java/cn/wildfire/chat/kit/conversationlist/ConversationListFragment.java index 48238c30..83bffa2d 100644 --- a/uikit/src/main/java/cn/wildfire/chat/kit/conversationlist/ConversationListFragment.java +++ b/uikit/src/main/java/cn/wildfire/chat/kit/conversationlist/ConversationListFragment.java @@ -174,6 +174,9 @@ public void onChanged(Object o) { } public void scrollToNextUnreadConversation() { + if(layoutManager == null || adapter == null){ + return; + } int start = layoutManager.findFirstVisibleItemPosition(); int nextUnreadConversationPosition = adapter.getNextUnreadConversationPosition(start); // 支持循环滚动,后面没有未读会话时,从头开始找