Skip to content

Commit 2410dae

Browse files
committed
fix(app): guard NSApp access in error badge rendering
NSApp is nil in test/CI environment. Use optional chaining to fall back to black (light mode) when unavailable.
1 parent 0d3cc8d commit 2410dae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/MeetingTranscriber/Sources/MenuBarIcon.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ enum MenuBarIcon {
9797

9898
case .error:
9999
// Use menu bar foreground color since this badge is non-template
100-
let appearance = NSApp.effectiveAppearance
101-
let isDark = appearance.bestMatch(from: [.darkAqua, .aqua]) == .darkAqua
100+
let isDark = NSApp?.effectiveAppearance
101+
.bestMatch(from: [.darkAqua, .aqua]) == .darkAqua
102102
(isDark ? NSColor.white : NSColor.black).setFill()
103103
drawRecordingAnimation(in: rect, frame: 0)
104104
drawExclamationBadge(in: rect)

0 commit comments

Comments
 (0)