fix potential crash when loading channel with no messages

This commit is contained in:
ouwou 2021-10-16 16:54:25 -04:00
parent 3e34f785c6
commit f1a39c006f

View File

@ -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) {