fix: prevent system messages from being ignored in multi-channel search (#3875)

This commit is contained in:
James Upjohn
2022-07-24 10:18:25 +00:00
committed by GitHub
parent c58552781d
commit 218718e930
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -188,7 +188,8 @@ LimitedQueueSnapshot<MessagePtr> SearchPopup::buildSnapshot()
auto uniqueIterator =
std::unique(combinedSnapshot.begin(), combinedSnapshot.end(),
[](MessagePtr &a, MessagePtr &b) {
return a->id == b->id;
// nullptr check prevents system messages from being dropped
return (a->id != nullptr) && a->id == b->id;
});
combinedSnapshot.erase(uniqueIterator, combinedSnapshot.end());