mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 20:25:33 +08:00
[ReactNative] Use RCTNullIfNill and (id)kCFNull
Summary: @public Use consistent `null` handling: `value || null` -> `RCTNullIfNil(value)` `value == null ? nil : value` -> `RCTNilIfNull(value)` `[NSNull null]` -> `(id)kCFNull` Test Plan: The tests should be enough.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
#import "RCTBridge.h"
|
||||
#import "RCTEventDispatcher.h"
|
||||
#import "RCTUtils.h"
|
||||
|
||||
NSString *const RCTOpenURLNotification = @"RCTOpenURLNotification";
|
||||
|
||||
@@ -76,7 +77,7 @@ RCT_EXPORT_METHOD(canOpenURL:(NSURL *)URL
|
||||
- (NSDictionary *)constantsToExport
|
||||
{
|
||||
NSURL *initialURL = _bridge.launchOptions[UIApplicationLaunchOptionsURLKey];
|
||||
return @{@"initialURL": [initialURL absoluteString] ?: [NSNull null]};
|
||||
return @{@"initialURL": RCTNullIfNil([initialURL absoluteString])};
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user