@@ -449,7 +449,7 @@ - (void)invokeWithBridge:(RCTBridge *)bridge
449449 // Set arguments
450450 NSUInteger index = 0 ;
451451 for (id json in arguments) {
452- id arg = (json == [ NSNull null ]) ? nil : json ;
452+ id arg = RCTNilIfNull (json) ;
453453 void (^block)(RCTBridge *, NSNumber *, NSInvocation *, NSUInteger , id ) = _argumentBlocks[index];
454454 block (bridge, context, invocation, index + 2 , arg);
455455 index++;
@@ -1012,7 +1012,7 @@ - (void)registerModules
10121012 if (queue) {
10131013 _queuesByID[moduleID] = queue;
10141014 } else {
1015- _queuesByID[moduleID] = [ NSNull null ] ;
1015+ _queuesByID[moduleID] = ( id ) kCFNull ;
10161016 }
10171017 }
10181018
@@ -1266,8 +1266,8 @@ - (void)enqueueApplicationScript:(NSString *)script url:(NSURL *)url onComplete:
12661266 context: context
12671267 callback: ^(id json, NSError *error) {
12681268 RCTProfileEndEvent (@" FetchApplicationScriptCallbacks" , @" js_call,init" , @{
1269- @" json" : json ?: [ NSNull null ] ,
1270- @" error" : error ?: [ NSNull null ] ,
1269+ @" json" : RCTNullIfNil ( json) ,
1270+ @" error" : RCTNullIfNil ( error) ,
12711271 });
12721272
12731273 [self _handleBuffer: json context: context];
@@ -1293,7 +1293,7 @@ - (void)dispatchBlock:(dispatch_block_t)block forModuleID:(NSNumber *)moduleID
12931293 queue = _queuesByID[moduleID];
12941294 }
12951295
1296- if (queue == [ NSNull null ] ) {
1296+ if (queue == ( id ) kCFNull ) {
12971297 [_javaScriptExecutor executeBlockOnJavaScriptQueue: block];
12981298 } else {
12991299 dispatch_async (queue ?: _methodQueue, block);
@@ -1509,7 +1509,7 @@ - (BOOL)_handleRequestNumber:(NSUInteger)i
15091509 @" module" : method.moduleClassName ,
15101510 @" method" : method.JSMethodName ,
15111511 @" selector" : NSStringFromSelector (method.selector ),
1512- @" args" : RCTJSONStringify (params ?: [ NSNull null ] , NULL ),
1512+ @" args" : RCTJSONStringify (RCTNullIfNil ( params) , NULL ),
15131513 });
15141514
15151515 return YES ;
0 commit comments