diff --git a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt index 31042b6500..fdf5eb6e9c 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt @@ -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 =