From 7db99a454d1db0e3e7e6b6676811dad9a26bd4b8 Mon Sep 17 00:00:00 2001 From: Jamil Date: Thu, 9 Jan 2025 11:47:51 -0800 Subject: [PATCH] fix(apple/macOS): Don't allow empty `WindowGroup` (#7716) On macOS 12, returning an empty body for a `WindowGroup` can cause the app UI to crash with the following error: ``` *** Assertion failure in void _NSWindowSetFrameIvar(NSWindow *, NSRect)(), NSWindow.m:935 ``` Since the `menuBar` is not initialized when the app initializes, this conditional can return an empty body in a race condition. Even though we're winding down support for macOS 12, it would be good to fix this logic bug. --- swift/apple/Firezone/Application/FirezoneApp.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/swift/apple/Firezone/Application/FirezoneApp.swift b/swift/apple/Firezone/Application/FirezoneApp.swift index c1a71136c..f53d5bcf2 100644 --- a/swift/apple/Firezone/Application/FirezoneApp.swift +++ b/swift/apple/Firezone/Application/FirezoneApp.swift @@ -45,6 +45,8 @@ struct FirezoneApp: App { if let menuBar = appDelegate.menuBar { // menuBar will be initialized by this point AppView(model: appViewModel).environmentObject(menuBar) + } else { + ProgressView("Loading...") } } .handlesExternalEvents(