Check for null manager type

This commit is contained in:
Ilya Fedin 2021-02-09 15:26:33 +04:00 committed by John Preston
parent 9b70f24e91
commit 03e8d28456

View file

@ -722,14 +722,14 @@ void Create(Window::Notifications::System *system) {
using ManagerType = Window::Notifications::ManagerType; using ManagerType = Window::Notifications::ManagerType;
if ((Core::App().settings().nativeNotifications() && Supported()) if ((Core::App().settings().nativeNotifications() && Supported())
|| Enforced()) { || Enforced()) {
if (*system->managerType() != ManagerType::Native) { if (!system->managerType().has_value()
|| *system->managerType() != ManagerType::Native) {
system->setManager(std::make_unique<Manager>(system)); system->setManager(std::make_unique<Manager>(system));
} }
} else { } else if (!system->managerType().has_value()
if (*system->managerType() != ManagerType::Default) { || *system->managerType() != ManagerType::Default) {
system->setManager(nullptr); system->setManager(nullptr);
} }
}
}; };
if (!ServiceRegistered) { if (!ServiceRegistered) {