Skip to content

Commit

Permalink
fix error crash connect websocket with header value null
Browse files Browse the repository at this point in the history
  • Loading branch information
lethanh9398 authored and thanhanh3653 committed Jul 31, 2024
1 parent 59da1ab commit 23c5b99
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ - (void)invalidate
if ([options.headers() isKindOfClass:NSDictionary.class]) {
NSDictionary *headers = (NSDictionary *)options.headers();
[headers enumerateKeysAndObjectsUsingBlock:^(NSString *key, id value, BOOL *stop) {
[request addValue:[RCTConvert NSString:value] forHTTPHeaderField:key];
if (![value isKindOfClass:[NSNull class]]) {
[request addValue:[RCTConvert NSString:value] forHTTPHeaderField:key];
}
}];
}

Expand Down

0 comments on commit 23c5b99

Please sign in to comment.