From 5fa69429a57080bfb446d1dbfb117e62003e2853 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Fri, 25 Dec 2020 02:24:42 +0100 Subject: [PATCH] Fix #4 --- td/generate/tl-parser | 2 +- td/telegram/MessagesManager.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/td/generate/tl-parser b/td/generate/tl-parser index 98b469c21..43ca916f6 160000 --- a/td/generate/tl-parser +++ b/td/generate/tl-parser @@ -1 +1 @@ -Subproject commit 98b469c21d7810ba17dc72c56c444a7b79668197 +Subproject commit 43ca916f66ce9e1c876579d32c69f52ef9dd73fe diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 18a3dee5c..f938d657d 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -14806,7 +14806,9 @@ void MessagesManager::on_message_deleted(Dialog *d, Message *m, bool is_permanen auto it = d->yet_unsent_thread_message_ids.find(m->top_thread_message_id); CHECK(it != d->yet_unsent_thread_message_ids.end()); auto is_deleted = it->second.erase(m->message_id) > 0; - CHECK(is_deleted); + if (!is_deleted) { + return; + } if (it->second.empty()) { d->yet_unsent_thread_message_ids.erase(it); } @@ -14814,7 +14816,9 @@ void MessagesManager::on_message_deleted(Dialog *d, Message *m, bool is_permanen cancel_send_deleted_message(d->dialog_id, m, is_permanently_deleted); - CHECK(m->message_id.is_valid()); + if (!m->message_id.is_valid()) { + return; + } switch (d->dialog_id.get_type()) { case DialogType::User: case DialogType::Chat: