Fix possible crash in ~RepliesWidget on logout.

This commit is contained in:
John Preston 2023-03-17 21:02:12 +04:00
parent f5ab3a54bf
commit e4834f583f

View File

@ -1087,7 +1087,7 @@ void Account::unregisterDraftSource(
void Account::writeDrafts(not_null<History*> history) {
const auto peerId = history->peer->id;
const auto &map = history->draftsMap();
const auto supportMode = _owner->session().supportMode();
const auto supportMode = history->session().supportMode();
const auto sourcesIt = _draftSources.find(history);
const auto &sources = (sourcesIt != _draftSources.end())
? sourcesIt->second
@ -1168,7 +1168,7 @@ void Account::writeDrafts(not_null<History*> history) {
void Account::writeDraftCursors(not_null<History*> history) {
const auto peerId = history->peer->id;
const auto &map = history->draftsMap();
const auto supportMode = _owner->session().supportMode();
const auto supportMode = history->session().supportMode();
const auto sourcesIt = _draftSources.find(history);
const auto &sources = (sourcesIt != _draftSources.end())
? sourcesIt->second