From 03e8d28456fbcb6f639ecf4e0d45491612052386 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Tue, 9 Feb 2021 15:26:33 +0400 Subject: [PATCH] Check for null manager type --- .../platform/linux/notifications_manager_linux.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index 7afdd560c7..eb7ca59e54 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -722,13 +722,13 @@ void Create(Window::Notifications::System *system) { using ManagerType = Window::Notifications::ManagerType; if ((Core::App().settings().nativeNotifications() && Supported()) || Enforced()) { - if (*system->managerType() != ManagerType::Native) { + if (!system->managerType().has_value() + || *system->managerType() != ManagerType::Native) { system->setManager(std::make_unique(system)); } - } else { - if (*system->managerType() != ManagerType::Default) { - system->setManager(nullptr); - } + } else if (!system->managerType().has_value() + || *system->managerType() != ManagerType::Default) { + system->setManager(nullptr); } };