From 30f4d870c5841587ce637420d8a47a857c7acb17 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 6 Sep 2019 14:46:03 +0300 Subject: [PATCH] Version 1.8.4: Fix crash on failed message delete. --- Telegram/SourceFiles/data/data_scheduled_messages.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/data/data_scheduled_messages.cpp b/Telegram/SourceFiles/data/data_scheduled_messages.cpp index 89e7a03d3..f0061d727 100644 --- a/Telegram/SourceFiles/data/data_scheduled_messages.cpp +++ b/Telegram/SourceFiles/data/data_scheduled_messages.cpp @@ -335,7 +335,7 @@ void ScheduledMessages::clearNotSending(not_null history) { } auto clear = base::flat_set>(); for (const auto &owned : i->second.items) { - if (!owned->isSending()) { + if (!owned->isSending() && !owned->hasFailed()) { clear.emplace(owned.get()); } } @@ -370,7 +370,7 @@ void ScheduledMessages::remove(not_null item) { Assert(i != end(_data)); auto &list = i->second; - if (!item->isSending()) { + if (!item->isSending() && !item->hasFailed()) { const auto j = list.idByItem.find(item); Assert(j != end(list.idByItem)); list.itemById.remove(j->second);