[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:
Stanislav Vishnevskiy 2015-06-11 18:02:52 -07:00
parent 394cc661a1
commit 86d4f4e20a
1 changed files with 1 additions and 1 deletions

View File

@ -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
}];