Merge pull request #4442 from nextcloud/bugfix/noid/fixPreviousChatMessageCrash

fix crash when getting previousChatMessage
This commit is contained in:
Sowjanya Kota 2024-11-13 16:03:12 +01:00 committed by GitHub
commit f0a9d6a1e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2663,8 +2663,8 @@ class ChatActivity :
chatMessage.activeUser = conversationUser
adapter?.let {
val previousChatMessage = adapter!!.items[1].item
if (previousChatMessage is ChatMessage) {
val previousChatMessage = it.items?.getOrNull(1)?.item
if (previousChatMessage != null && previousChatMessage is ChatMessage) {
chatMessage.isGrouped = groupMessages(chatMessage, previousChatMessage)
}
chatMessage.isOneToOneConversation =