Fix crash when adding recent messages to empty Channel (#3932)
* Fix crash when adding recent messages to empty Channel * Update CHANGELOG.md
This commit is contained in:
@@ -237,7 +237,20 @@ void Channel::addMessagesAtStart(const std::vector<MessagePtr> &_messages)
|
||||
|
||||
void Channel::fillInMissingMessages(const std::vector<MessagePtr> &messages)
|
||||
{
|
||||
if (messages.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto snapshot = this->getMessageSnapshot();
|
||||
if (snapshot.size() == 0)
|
||||
{
|
||||
// There are no messages in this channel yet so we can just insert them
|
||||
// at the front in order
|
||||
this->messages_.pushFront(messages);
|
||||
this->filledInMessages.invoke(messages);
|
||||
return;
|
||||
}
|
||||
|
||||
std::unordered_set<QString> existingMessageIds;
|
||||
existingMessageIds.reserve(snapshot.size());
|
||||
|
||||
Reference in New Issue
Block a user