Add more checks.

This commit is contained in:
levlam 2023-08-15 17:55:12 +03:00
parent a0990ef2fd
commit 5a60e62892
2 changed files with 3 additions and 0 deletions

View File

@ -8475,6 +8475,7 @@ void MessagesManager::set_active_reactions(vector<ReactionType> active_reaction_
auto old_active_reaction_pos_ = std::move(active_reaction_pos_); auto old_active_reaction_pos_ = std::move(active_reaction_pos_);
active_reaction_pos_.clear(); active_reaction_pos_.clear();
for (size_t i = 0; i < active_reaction_types_.size(); i++) { for (size_t i = 0; i < active_reaction_types_.size(); i++) {
CHECK(!active_reaction_types_[i].is_empty());
active_reaction_pos_[active_reaction_types_[i]] = i; active_reaction_pos_[active_reaction_types_[i]] = i;
} }

View File

@ -3975,6 +3975,8 @@ void StoryManager::do_send_story(unique_ptr<PendingStory> &&pending_story, vecto
send_update_story(story_full_id, story.get()); send_update_story(story_full_id, story.get());
stories_.set(story_full_id, std::move(story)); stories_.set(story_full_id, std::move(story));
CHECK(pending_story->dialog_id_.is_valid());
CHECK(pending_story->random_id_ != 0);
yet_unsent_stories_[pending_story->dialog_id_].insert(pending_story->send_story_num_); yet_unsent_stories_[pending_story->dialog_id_].insert(pending_story->send_story_num_);
being_sent_stories_[pending_story->random_id_] = story_full_id; being_sent_stories_[pending_story->random_id_] = story_full_id;
} else { } else {