diff --git a/app/src/main/java/com/nextcloud/talk/chat/data/network/OfflineFirstChatRepository.kt b/app/src/main/java/com/nextcloud/talk/chat/data/network/OfflineFirstChatRepository.kt index fd3a4f4ab99..a97c13a8e2b 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/data/network/OfflineFirstChatRepository.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/data/network/OfflineFirstChatRepository.kt @@ -449,9 +449,11 @@ class OfflineFirstChatRepository @Inject constructor( // the parent message is always the newest state, no matter how old the system message is. // that's why we can just take the parent, update it in DB and update the UI messageJson.parentMessage?.let { parentMessageJson -> - val parentMessageEntity = parentMessageJson.asEntity(currentUser.id!!) - chatDao.upsertChatMessage(parentMessageEntity) - _updateMessageFlow.emit(parentMessageEntity.asModel()) + parentMessageJson.message?.let { + val parentMessageEntity = parentMessageJson.asEntity(currentUser.id!!) + chatDao.upsertChatMessage(parentMessageEntity) + _updateMessageFlow.emit(parentMessageEntity.asModel()) + } } }