From 5171c0bd7792998158976365474a7b9917705edf Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Tue, 11 Feb 2020 10:40:50 +0400 Subject: [PATCH] Fix crash when tray icon is disabled on macOS --- Telegram/SourceFiles/platform/mac/main_window_mac.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/platform/mac/main_window_mac.mm b/Telegram/SourceFiles/platform/mac/main_window_mac.mm index 32f6ae0a5..023ab2b90 100644 --- a/Telegram/SourceFiles/platform/mac/main_window_mac.mm +++ b/Telegram/SourceFiles/platform/mac/main_window_mac.mm @@ -555,8 +555,8 @@ void MainWindow::psTrayMenuUpdated() { && trayIcon->contextMenu() != trayIconMenu) { trayIcon->setContextMenu(trayIconMenu); } - } else { - trayIcon->setContextMenu(0); + } else if (trayIcon) { + trayIcon->setContextMenu(nullptr); } }