[WebSocket] Reason can be null which causes an exception with NSDictionary in websocketClosed
Summary: I am not 100% sure what causes reason to be null but it does happen. Closes https://github.com/facebook/react-native/pull/1483 Github Author: Stanislav Vishnevskiy <vishnevskiy@gmail.com> Test Plan: Imported from GitHub, without a `Test Plan:` line.
This commit is contained in:
parent
21a64189d6
commit
30a708e357
|
@ -107,7 +107,7 @@ RCT_EXPORT_METHOD(close:(NSNumber *)socketID)
|
|||
{
|
||||
[_bridge.eventDispatcher sendDeviceEventWithName:@"websocketClosed" body:@{
|
||||
@"code": @(code),
|
||||
@"reason": reason,
|
||||
@"reason": reason ? reason : [NSNull null],
|
||||
@"clean": @(wasClean),
|
||||
@"id": webSocket.reactTag
|
||||
}];
|
||||
|
|
Loading…
Reference in New Issue