diff --git a/Telegram/SourceFiles/window/window_session_controller.cpp b/Telegram/SourceFiles/window/window_session_controller.cpp index 7f82d249f5..4233de0485 100644 --- a/Telegram/SourceFiles/window/window_session_controller.cpp +++ b/Telegram/SourceFiles/window/window_session_controller.cpp @@ -1749,7 +1749,15 @@ void SessionController::showSection( } void SessionController::showBackFromStack(const SectionShow ¶ms) { - content()->showBackFromStack(params); + const auto bad = [&] { + // If we show a currently-being-destroyed topic, then + // skip it and show back one more. + const auto topic = _activeChatEntry.current().key.topic(); + return topic && topic->forum()->topicDeleted(topic->rootId()); + }; + do { + content()->showBackFromStack(params); + } while (bad()); } void SessionController::showSpecialLayer(