Skip to content

Commit

Permalink
fix: crash create app router - WPB-15683 (#2443)
Browse files Browse the repository at this point in the history
Co-authored-by: François Benaiteau <[email protected]>
  • Loading branch information
github-actions[bot] and netbe authored Jan 29, 2025
1 parent b4d966a commit 080839c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion wire-ios/Wire-iOS/Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,11 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
}

func applicationProtectedDataDidBecomeAvailable(_ application: UIApplication) {
guard appRootRouter == nil else { return }
WireLogger.appDelegate.info("applicationProtectedDataDidBecomeAvailable", attributes: .safePublic)
guard appRootRouter == nil else {
WireLogger.appDelegate.debug("applicationProtectedDataDidBecomeAvailable: appRootRouter nil")
return
}
createAppRootRouterAndInitialiazeOperations(launchOptions)
}
}
Expand All @@ -347,6 +351,12 @@ private extension AppDelegate {
fatalError("sessionManager is not created")
}

guard mainWindow != nil else {
WireLogger.appDelegate.critical("no mainWindow this should not be possible at this point")
assertionFailure("no mainWindow this should not be possible at this point")
return
}

appRootRouter = AppRootRouter(
mainWindow: mainWindow,
sessionManager: sessionManager,
Expand Down

0 comments on commit 080839c

Please sign in to comment.