     }
 
     @objc func openDebugAlert() {
+        guard let rootViewController = AppDelegate.shared?.window?.rootViewController else {
+            Log.warn("Debug alert unable to present since the window rootViewController is nil")
+            return
+        }
+
         var debug: UIAlertController
 
         if let dictionary = Bundle.main.infoDictionary,

        debug.addAction(UIAlertAction(title: "Cancel",
                                      style: .cancel, handler: nil))

        var topMostViewController = AppDelegate.shared?.window?.rootViewController
        while topMostViewController?.presentedViewController != nil {
            topMostViewController = topMostViewController?.presentedViewController
        }
        topMostViewController?.present(debug, animated: true, completion: nil)
    }


}

fileprivate class DebugMenu {
    static let shared: DebugMenu = DebugMenu()

    func enableDebugGesture(_ viewController: UIViewController) {
