Add key validness checks before adding to FlatHashSet.
This commit is contained in:
parent
0369a1a185
commit
78f3363486
@ -17720,6 +17720,7 @@ bool MessagesManager::set_folder_pinned_dialogs(FolderId folder_id, vector<Dialo
|
|||||||
|
|
||||||
FlatHashSet<DialogId, DialogIdHash> all_old_pinned_dialog_ids;
|
FlatHashSet<DialogId, DialogIdHash> all_old_pinned_dialog_ids;
|
||||||
for (auto dialog_id : old_dialog_ids) {
|
for (auto dialog_id : old_dialog_ids) {
|
||||||
|
CHECK(dialog_id.is_valid());
|
||||||
all_old_pinned_dialog_ids.insert(dialog_id);
|
all_old_pinned_dialog_ids.insert(dialog_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -767,6 +767,7 @@ bool SavedMessagesManager::set_pinned_saved_messages_topics(vector<SavedMessages
|
|||||||
<< saved_messages_topic_ids;
|
<< saved_messages_topic_ids;
|
||||||
FlatHashSet<SavedMessagesTopicId, SavedMessagesTopicIdHash> old_pinned_saved_messages_topic_ids;
|
FlatHashSet<SavedMessagesTopicId, SavedMessagesTopicIdHash> old_pinned_saved_messages_topic_ids;
|
||||||
for (auto pinned_saved_messages_topic_id : topic_list_.pinned_saved_messages_topic_ids_) {
|
for (auto pinned_saved_messages_topic_id : topic_list_.pinned_saved_messages_topic_ids_) {
|
||||||
|
CHECK(pinned_saved_messages_topic_id.is_valid());
|
||||||
old_pinned_saved_messages_topic_ids.insert(pinned_saved_messages_topic_id);
|
old_pinned_saved_messages_topic_ids.insert(pinned_saved_messages_topic_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user