From 6d9792e9ea44e4e616c7a6301792116a3646c015 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 19 Mar 2018 20:42:45 +0300 Subject: [PATCH] Fix yet_unsent_media_queues_. GitOrigin-RevId: 6249449a81bede3cc596c8670b66800551df1587 --- td/telegram/MessagesManager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 5a11ca7e..a2b603db 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -16458,6 +16458,10 @@ void MessagesManager::on_media_message_ready_to_send(DialogId dialog_id, Message auto &queue = yet_unsent_media_queues_[queue_id]; auto it = queue.find(message_id.get()); if (it == queue.end()) { + if (queue.empty()) { + yet_unsent_media_queues_.erase(queue_id); + } + LOG(INFO) << "Can't find " << message_id << " in the queue of " << dialog_id; auto m = get_message({dialog_id, message_id}); if (m != nullptr) {