diff --git a/setup.cfg b/setup.cfg index 55c67a31..f33499d7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -38,7 +38,7 @@ install_requires = keyring apscheduler sentry-sdk - pyobjc-framework-Cocoa + pyobjc-framework-Cocoa; sys_platform == 'darwin' tests_require = pytest pytest-qt diff --git a/src/vorta/notifications.py b/src/vorta/notifications.py index ee899174..4b3a411f 100644 --- a/src/vorta/notifications.py +++ b/src/vorta/notifications.py @@ -25,7 +25,8 @@ class DarwinNotifications(VortaNotifications): notification.setTitle_(title) notification.setInformativeText_(text) center = NSUserNotificationCenter.defaultUserNotificationCenter() - center.deliverNotification_(notification) + if center is not None: # Only works when run from app bundle. + center.deliverNotification_(notification) class LinuxNotifications(VortaNotifications):