UIWindow makeKeyAndVisible crash

In our app, there is a UIWindow makeKeyAndVisible crash, and for now, it appears once, crash stack:

the crash detail:

in the RCWindowSceneManager class's makeWindowKeyAndVisible method, we check and set a window's windowScene and makeKeyAndVisible:

    public func makeWindowKeyAndVisible(_ window: UIWindow?) {
        guard let window else {
            return
        }

        if let currentWindowScene {
            if window.windowScene == nil || window.windowScene != currentWindowScene {
                window.windowScene = currentWindowScene
            }
            window.makeKeyAndVisible()
        }
    }

and I set a break point at a normal no crash flow, the stack is:

why it crash? and how we avoid this, thank you.

UIWindow makeKeyAndVisible crash
 
 
Q