Merge pull request #2835 from nextcloud/bugfix/2834/avoidNPEscrollToMessage

Avoid NPE (replace scrollToPositionWithOffset(..) with scrollToPositi…
This commit is contained in:
Marcel Hibbe 2023-03-06 13:38:36 +01:00 committed by GitHub
commit 1b843d85d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2495,10 +2495,7 @@ class ChatController(args: Bundle) :
addMessagesToAdapter(shouldAddNewMessagesNotice, chatMessageList)
if (shouldAddNewMessagesNotice && adapter != null) {
layoutManager?.scrollToPositionWithOffset(
adapter!!.getMessagePositionByIdInReverse("-1"),
binding?.messagesListView?.height!! / 2
)
layoutManager?.scrollToPosition(0)
}
}