fix(iOS): Fix crash when localPort or connectedPort is null#172
fix(iOS): Fix crash when localPort or connectedPort is null#172Yahui-Ren wants to merge 4 commits intoRapsssito:masterfrom
Conversation
|
Hi @Rapsssito, could you please explain why this was closed? |
|
@landabaso, sorry for closing this without any explanation. I have added my review. |
| } else { | ||
| // Default certificates | ||
| [settings setObject:_host forKey:(NSString *)kCFStreamSSLPeerName]; |
There was a problem hiding this comment.
Why should the default certificates be removed?
| if([socket localHost] != nil && [socket connectedHost] != nil && [socket localPort] != nil | ||
| && [socket connectedPort] != nil) { |
There was a problem hiding this comment.
This fixes #197, but what is the reason behind these properties being nil?
| NSString *msg = | ||
| [NSString stringWithFormat:@"no client found with id %@", client.id]; | ||
| [self sendEventWithName:@"error" body:@{@"id" : client.id, @"error" : msg}]; |
There was a problem hiding this comment.
Is this the correct error message?
|
Hi @Rapsssito, when I patch-packaged + if ([socket localPort] != nil && [socket connectedPort] != nil)This alone prevented the crashes on iOS. It looks like @Yahui-Ren may not be active anymore, since this PR is from early 2023. The simple check above should be enough to avoid crashes on iOS. |
|
@landabaso, feel free to create a new PR with those changes! |
|
@Rapsssito has this fix officialy been merged into the project? I'm having the same problem on iOS after upgrading to RN 0.77.3 |
|
Created a new pull request here with the changes @landabaso and @Rapsssito suggested. #172 (comment) |
It will send an error event when connectedPort or localPort is null