[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
Родитель 394cc661a1
Коммит 86d4f4e20a
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

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