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 7594df22f..984abb5bc 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt @@ -1195,8 +1195,10 @@ class ChatActivity : this, object : MessageSwipeActions { override fun showReplyUI(position: Int) { - val chatMessage = adapter?.items?.get(position)?.item as ChatMessage? - replyToMessage(chatMessage) + val chatMessage = adapter?.items?.getOrNull(position)?.item as ChatMessage? + if (chatMessage != null) { + replyToMessage(chatMessage) + } } } )