Fix possible crash in scheduled messages.

This commit is contained in:
John Preston 2019-09-27 18:49:49 +03:00
parent d17f21c10d
commit 09547bd6d5
1 changed files with 1 additions and 7 deletions
Telegram/SourceFiles/data

View File

@ -193,13 +193,7 @@ void ScheduledMessages::removeSending(not_null<HistoryItem*> item) {
Expects(item->isSending() || item->hasFailed());
Expects(item->isScheduled());
const auto history = item->history();
auto &list = _data[history];
Assert(!list.itemById.contains(item->id));
Assert(!list.idByItem.contains(item));
list.items.erase(
ranges::remove(list.items, item.get(), &OwnedItem::get),
end(list.items));
item->destroy();
}
rpl::producer<> ScheduledMessages::updates(not_null<History*> history) {