mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +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:
@@ -13,6 +13,7 @@
|
||||
#import "RCTEventDispatcher.h"
|
||||
#import "RCTSRWebSocket.h"
|
||||
#import "RCTSparseArray.h"
|
||||
#import "RCTUtils.h"
|
||||
|
||||
@implementation RCTSRWebSocket (React)
|
||||
|
||||
@@ -107,7 +108,7 @@ RCT_EXPORT_METHOD(close:(NSNumber *)socketID)
|
||||
{
|
||||
[_bridge.eventDispatcher sendDeviceEventWithName:@"websocketClosed" body:@{
|
||||
@"code": @(code),
|
||||
@"reason": reason ? reason : [NSNull null],
|
||||
@"reason": RCTNullIfNil(reason),
|
||||
@"clean": @(wasClean),
|
||||
@"id": webSocket.reactTag
|
||||
}];
|
||||
|
||||
Reference in New Issue
Block a user