fix: crash on new dialog

This commit is contained in:
ZavaruKitsu 2023-08-07 16:02:59 +00:00
parent 17a9c5c382
commit 34fa52e5fb

View file

@ -3892,10 +3892,11 @@ void HistoryWidget::send(Api::SendOptions options) {
options.scheduled = current + 12;
}
if (!settings->sendReadMessages && settings->markReadAfterSend)
auto lastMessage = _history->lastMessage();
if (!settings->sendReadMessages && settings->markReadAfterSend && lastMessage)
{
AyuState::setAllowSendReadPacket(true);
_history->session().data().histories().readInboxOnNewMessage(_history->lastMessage());
_history->session().data().histories().readInboxOnNewMessage(lastMessage);
}
if (!_history) {