Fix crash in Pip-to-Viewer after message deletion.

Fixes #25262. Fixes #25522.
This commit is contained in:
John Preston 2022-12-30 14:18:04 +04:00
parent d02819db13
commit 0ce01410a1

View file

@ -3334,14 +3334,14 @@ void OverlayWidget::switchToPip() {
Expects(_document != nullptr); Expects(_document != nullptr);
const auto document = _document; const auto document = _document;
const auto message = _message; const auto messageId = _message ? _message->fullId() : FullMsgId();
const auto topicRootId = _topicRootId; const auto topicRootId = _topicRootId;
const auto closeAndContinue = [=] { const auto closeAndContinue = [=] {
_showAsPip = false; _showAsPip = false;
show(OpenRequest( show(OpenRequest(
findWindow(false), findWindow(false),
document, document,
message, document->owner().message(messageId),
topicRootId, topicRootId,
true)); true));
}; };