From 9bc32a010176e679892f1721cb80201befbf3a3e Mon Sep 17 00:00:00 2001 From: Devan Buggay Date: Wed, 14 Aug 2024 15:22:58 -0700 Subject: [PATCH] Fix minimize/restore crash (#46023) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46023 Minimizing and restoring a Mac Catalyst app causes an `interfaceOrientationDidChange` which causes a downstream crash on `application.delegate.window`. There doesn't seem to be a clean way to get if an app is fullscreen in Mac Catalyst, so just no-oping for now. Changelog: [Internal] Reviewed By: shwanton Differential Revision: D61253706 fbshipit-source-id: 73d260366adcc74e88f43f256cc5aff8a6e3ef71 --- packages/react-native/React/CoreModules/RCTDeviceInfo.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/React/CoreModules/RCTDeviceInfo.mm b/packages/react-native/React/CoreModules/RCTDeviceInfo.mm index b72352f5453..454a3252cc5 100644 --- a/packages/react-native/React/CoreModules/RCTDeviceInfo.mm +++ b/packages/react-native/React/CoreModules/RCTDeviceInfo.mm @@ -214,7 +214,7 @@ static NSDictionary *RCTExportedDimensions(CGFloat fontScale) - (void)_interfaceOrientationDidChange { -#if TARGET_OS_IOS +#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST UIApplication *application = RCTSharedApplication(); UIInterfaceOrientation nextOrientation = RCTKeyWindow().windowScene.interfaceOrientation;