From 0ce01410a10c4219b68844a832432290072d081c Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 30 Dec 2022 14:18:04 +0400 Subject: [PATCH] Fix crash in Pip-to-Viewer after message deletion. Fixes #25262. Fixes #25522. --- Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index b2c233f4ef..775213ab88 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -3334,14 +3334,14 @@ void OverlayWidget::switchToPip() { Expects(_document != nullptr); const auto document = _document; - const auto message = _message; + const auto messageId = _message ? _message->fullId() : FullMsgId(); const auto topicRootId = _topicRootId; const auto closeAndContinue = [=] { _showAsPip = false; show(OpenRequest( findWindow(false), document, - message, + document->owner().message(messageId), topicRootId, true)); };