aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient/private/GRPCChannelPool.m
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-10-17 17:06:16 -0700
committerGravatar Muxi Yan <mxyan@google.com>2018-10-17 17:06:16 -0700
commitd47f4b4c23a9dab2813e9b521d2545ea26d0105c (patch)
tree9e77ba0f9abd4b48f8749a475fc17d25bf170847 /src/objective-c/GRPCClient/private/GRPCChannelPool.m
parent8fef0c87893ceda1c5bb7aaa09ddb8dfaefacbdb (diff)
Check return value rather than error
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCChannelPool.m')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCChannelPool.m7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCChannelPool.m b/src/objective-c/GRPCClient/private/GRPCChannelPool.m
index 7c0a8a8621..740eeaf6cf 100644
--- a/src/objective-c/GRPCClient/private/GRPCChannelPool.m
+++ b/src/objective-c/GRPCClient/private/GRPCChannelPool.m
@@ -36,8 +36,8 @@ extern const char *kCFStreamVarName;
- (nullable instancetype)initWithHost:(NSString *)host callOptions:(GRPCCallOptions *)callOptions {
if ((self = [super init])) {
- _host = host;
- _callOptions = callOptions;
+ _host = [host copy];
+ _callOptions = [callOptions copy];
}
return self;
}
@@ -56,9 +56,8 @@ extern const char *kCFStreamVarName;
privateKey:_callOptions.PEMPrivateKey
certChain:_callOptions.PEMCertChain
error:&error];
- if (error) {
+ if (factory == nil) {
NSLog(@"Error creating secure channel factory: %@", error);
- return nil;
}
return factory;
#ifdef GRPC_COMPILE_WITH_CRONET