diff --git a/app/src/ui/lib/theme-change-monitor.ts b/app/src/ui/lib/theme-change-monitor.ts index c1998ccd6b2..e17593bbf93 100644 --- a/app/src/ui/lib/theme-change-monitor.ts +++ b/app/src/ui/lib/theme-change-monitor.ts @@ -11,6 +11,10 @@ class ThemeChangeMonitor implements IDisposable { } public dispose() { + if (remote.nativeTheme == null) { + return + } + remote.nativeTheme.removeAllListeners() } @@ -19,6 +23,10 @@ class ThemeChangeMonitor implements IDisposable { return } + if (remote.nativeTheme == null) { + return + } + remote.nativeTheme.addListener('updated', this.onThemeNotificationFromOS) }