2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Version 1.8.4: Fix crash on failed message delete.

This commit is contained in:
John Preston
2019-09-06 14:46:03 +03:00
parent ad515c6f4a
commit 30f4d870c5

View File

@@ -335,7 +335,7 @@ void ScheduledMessages::clearNotSending(not_null<History*> history) {
}
auto clear = base::flat_set<not_null<HistoryItem*>>();
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<const HistoryItem*> 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);