summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--components/chatlist.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/components/chatlist.cpp b/components/chatlist.cpp
index 96d8de2..5b3f357 100644
--- a/components/chatlist.cpp
+++ b/components/chatlist.cpp
@@ -243,7 +243,10 @@ void ChatList::RefetchMessage(Snowflake id) {
}
Snowflake ChatList::GetOldestListedMessage() {
- return m_id_to_widget.begin()->first;
+ if (m_id_to_widget.size() > 0)
+ return m_id_to_widget.begin()->first;
+ else
+ return Snowflake::Invalid;
}
void ChatList::UpdateMessageReactions(Snowflake id) {