From 3ad29f6eb715b6aea255339daa6f97c35ac79edc Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 11 Dec 2018 16:22:27 +0400 Subject: [PATCH] Fix crash in media preview. --- Telegram/SourceFiles/mainwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp index 3d241eab5..7c3006d26 100644 --- a/Telegram/SourceFiles/mainwindow.cpp +++ b/Telegram/SourceFiles/mainwindow.cpp @@ -81,6 +81,9 @@ MainWindow::MainWindow() { subscribe(Messenger::Instance().authSessionChanged(), [this] { updateGlobalMenu(); + if (!AuthSession::Exists()) { + _mediaPreview.destroy(); + } }); subscribe(Window::Theme::Background(), [this](const Window::Theme::BackgroundUpdate &data) { themeUpdated(data);