Skip to content
Snippets Groups Projects
Commit 39ba3c02 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

account: don't sort empty conversation list

Change-Id: Ie3b898b9efe329ab4b7cbab6eb2988c83bdcbae8
parent f55a70a7
No related branches found
No related tags found
No related merge requests found
......@@ -741,9 +741,11 @@ class Account(
private fun getSortedConversations(): List<Conversation> {
if (conversationsChanged) {
sortedConversations.clear()
sortedConversations.addAll(conversations.values)
for (c in sortedConversations) c.sortHistory()
Collections.sort(sortedConversations, ConversationComparator())
if (conversations.isNotEmpty()) {
sortedConversations.addAll(conversations.values)
for (c in sortedConversations) c.sortHistory()
Collections.sort(sortedConversations, ConversationComparator())
}
conversationsChanged = false
}
return sortedConversations
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment