mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 22:29:09 +00:00
Merge pull request #2835 from nextcloud/bugfix/2834/avoidNPEscrollToMessage
Avoid NPE (replace scrollToPositionWithOffset(..) with scrollToPositi…
This commit is contained in:
commit
1b843d85d9
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user