mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-07 06:39:45 +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)
|
addMessagesToAdapter(shouldAddNewMessagesNotice, chatMessageList)
|
||||||
|
|
||||||
if (shouldAddNewMessagesNotice && adapter != null) {
|
if (shouldAddNewMessagesNotice && adapter != null) {
|
||||||
layoutManager?.scrollToPositionWithOffset(
|
layoutManager?.scrollToPosition(0)
|
||||||
adapter!!.getMessagePositionByIdInReverse("-1"),
|
|
||||||
binding?.messagesListView?.height!! / 2
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user