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
1 changed files with 5 additions and 5 deletions

View File

@ -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<Manager>(system));
}
} else {
if (*system->managerType() != ManagerType::Default) {
system->setManager(nullptr);
}
} else if (!system->managerType().has_value()
|| *system->managerType() != ManagerType::Default) {
system->setManager(nullptr);
}
};