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 9af2aaa32..ed2ac7d4d 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt @@ -861,14 +861,15 @@ class ChatActivity : var chatMessageList = triple.third chatMessageList = handleSystemMessages(chatMessageList) + if (chatMessageList.isEmpty()) { + return@onEach + } determinePreviousMessageIds(chatMessageList) handleExpandableSystemMessages(chatMessageList) - if (chatMessageList.isNotEmpty() && - ChatMessage.SystemMessageType.CLEARED_CHAT == chatMessageList[0].systemMessageType - ) { + if (ChatMessage.SystemMessageType.CLEARED_CHAT == chatMessageList[0].systemMessageType) { adapter?.clear() adapter?.notifyDataSetChanged() }