From e021b7df8ad162ecbc0ab098776198521dfa46d4 Mon Sep 17 00:00:00 2001 From: khanhduytran0 Date: Sat, 3 Aug 2024 17:39:52 +0700 Subject: [PATCH] Fix: currentWindowInScene may unexpectedly return null This is caused by AirPlay bug fix (https://github.com/PojavLauncherTeam/PojavLauncher_iOS/commit/bc8d5a9) --- Natives/UIKit+hook.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Natives/UIKit+hook.m b/Natives/UIKit+hook.m index 31248a4b1a..da9ea44410 100644 --- a/Natives/UIKit+hook.m +++ b/Natives/UIKit+hook.m @@ -145,7 +145,7 @@ - (BOOL)forceFullHeightInLandscape { @end UIWindow* currentWindowInScene(BOOL external) { - id delegate; + id delegate = UIApplication.sharedApplication.delegate; for (UIScene *scene in UIApplication.sharedApplication.connectedScenes.allObjects) { if (external != (scene.session.role == UIWindowSceneSessionRoleApplication)) { delegate = scene.delegate;