From 080839cbc7718f3818eb0d24f15b9760d014b48f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 11:18:04 +0000 Subject: [PATCH] fix: crash create app router - WPB-15683 (#2443) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: François Benaiteau --- wire-ios/Wire-iOS/Sources/AppDelegate.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/wire-ios/Wire-iOS/Sources/AppDelegate.swift b/wire-ios/Wire-iOS/Sources/AppDelegate.swift index 3f3a06a3391..060999f9a35 100644 --- a/wire-ios/Wire-iOS/Sources/AppDelegate.swift +++ b/wire-ios/Wire-iOS/Sources/AppDelegate.swift @@ -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) } } @@ -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,