From a7d7bacf3b8cddc9cec8b5d06dda2b8e932ff998 Mon Sep 17 00:00:00 2001 From: Psypeal Gwai Date: Sun, 22 Feb 2026 05:40:39 -0800 Subject: [PATCH] fix: guard Notification.isSupported for standalone/Docker (#42) Add typeof checks before calling Notification.isSupported() to prevent crashes in environments where the Notification API is unavailable. --- src/main/services/infrastructure/NotificationManager.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/services/infrastructure/NotificationManager.ts b/src/main/services/infrastructure/NotificationManager.ts index 6eba59a6..a92db953 100644 --- a/src/main/services/infrastructure/NotificationManager.ts +++ b/src/main/services/infrastructure/NotificationManager.ts @@ -373,8 +373,12 @@ export class NotificationManager extends EventEmitter { * Shows a native macOS notification for an error. */ private showNativeNotification(error: DetectedError): void { - // Check if Notification is supported - if (!Notification.isSupported()) { + // Guard against standalone/Docker mode where Electron's Notification API is unavailable + if ( + typeof Notification === 'undefined' || + typeof Notification.isSupported !== 'function' || + !Notification.isSupported() + ) { logger.warn('Native notifications not supported'); return; }