From 5a60e62892828b7af66e625fc248e1d8d4795a57 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 15 Aug 2023 17:55:12 +0300 Subject: [PATCH] Add more checks. --- td/telegram/MessagesManager.cpp | 1 + td/telegram/StoryManager.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 01b7a26fd..53cf52f84 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -8475,6 +8475,7 @@ void MessagesManager::set_active_reactions(vector active_reaction_ auto old_active_reaction_pos_ = std::move(active_reaction_pos_); active_reaction_pos_.clear(); 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; } diff --git a/td/telegram/StoryManager.cpp b/td/telegram/StoryManager.cpp index 9ea84ac1a..b0324ae42 100644 --- a/td/telegram/StoryManager.cpp +++ b/td/telegram/StoryManager.cpp @@ -3975,6 +3975,8 @@ void StoryManager::do_send_story(unique_ptr &&pending_story, vecto send_update_story(story_full_id, story.get()); 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_); being_sent_stories_[pending_story->random_id_] = story_full_id; } else {