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.
This commit is contained in:
Jamil
2025-01-09 11:47:51 -08:00
committed by GitHub
parent a5e398b843
commit 7db99a454d

View File

@@ -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(