From 9ef74c510c2f24a7ca03de6a8a2156bf39a59bef Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 1 Jul 2024 09:07:45 +0400 Subject: [PATCH] Fix crash in opening topics in a new window. --- Telegram/SourceFiles/window/window_peer_menu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index 712e022b0..19b2d2580 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -689,8 +689,9 @@ void Filler::addNewWindow() { _addAction(tr::lng_context_new_window(tr::now), [=] { Ui::PreventDelayedActivation(); if (const auto strong = weak.get()) { + const auto forum = !strong->asTopic() && peer->isForum(); controller->showInNewWindow(SeparateId( - peer->isForum() ? SeparateType::Forum : SeparateType::Chat, + forum ? SeparateType::Forum : SeparateType::Chat, strong)); } }, &st::menuIconNewWindow);