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 chatMessage.activeUser = conversationUser
adapter?.let { adapter?.let {
val previousChatMessage = adapter!!.items[1].item val previousChatMessage = it.items?.getOrNull(1)?.item
if (previousChatMessage is ChatMessage) { if (previousChatMessage != null && previousChatMessage is ChatMessage) {
chatMessage.isGrouped = groupMessages(chatMessage, previousChatMessage) chatMessage.isGrouped = groupMessages(chatMessage, previousChatMessage)
} }
chatMessage.isOneToOneConversation = chatMessage.isOneToOneConversation =