Skip to content

Commit 4bd883f

Browse files
committed
test: upstream fix for release mode iOS crash
This fixes a null-handling crash bug upstream that we trigger in functions and firestore It is preseent in 0.77.1, and 0.78.0 It is fixed upstream in 0.77.2 and 0.78.1 and 0.79.0 This patch may be dropped once one of those versions with the fixed is adopted here The crash would not be triggered in our "other" platform support as those don't rely on the native null handling in functions and firestore
1 parent 5360b9d commit 4bd883f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
diff --git a/node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm b/node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm
2+
index 9ff5638..740a202 100644
3+
--- a/node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm
4+
+++ b/node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm
5+
@@ -446,6 +446,15 @@ void ObjCInteropTurboModule::setInvocationArg(
6+
7+
if (objCArgType == @encode(id)) {
8+
id arg = RCTConvertTo<id>(selector, objCArg);
9+
+
10+
+ // Handle the special case where there is an argument and it must be nil
11+
+ // Without this check, the JS side will receive an object.
12+
+ // See: discussion at
13+
+ // https://github.com/facebook/react-native/pull/49250#issuecomment-2668465893
14+
+ if (arg == [NSNull null]) {
15+
+ return;
16+
+ }
17+
+
18+
if (arg) {
19+
[retainedObjectsForInvocation addObject:arg];
20+
}

0 commit comments

Comments
 (0)