aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient/private/GRPCSecureChannelFactory.m
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-12-06 18:26:51 -0800
committerGravatar Muxi Yan <mxyan@google.com>2018-12-06 18:26:51 -0800
commitda759f1fc63ceb0c893bb6027bacfadfda5ab111 (patch)
treee529cda89aaf09bbc91b95505bc0d5fdc615851a /src/objective-c/GRPCClient/private/GRPCSecureChannelFactory.m
parentf9e50322bf1d6be736b415831eea44130b9dedfe (diff)
batch fixes
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCSecureChannelFactory.m')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCSecureChannelFactory.m5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCSecureChannelFactory.m b/src/objective-c/GRPCClient/private/GRPCSecureChannelFactory.m
index 69f70de17d..3ccc70a744 100644
--- a/src/objective-c/GRPCClient/private/GRPCSecureChannelFactory.m
+++ b/src/objective-c/GRPCClient/private/GRPCSecureChannelFactory.m
@@ -22,7 +22,6 @@
#import "ChannelArgsUtil.h"
#import "GRPCChannel.h"
-#import "utilities.h"
@implementation GRPCSecureChannelFactory {
grpc_channel_credentials *_channelCreds;
@@ -116,6 +115,10 @@
}
- (grpc_channel *)createChannelWithHost:(NSString *)host channelArgs:(NSDictionary *)args {
+ NSAssert(host.length != 0, @"host cannot be empty");
+ if (host.length == 0) {
+ return NULL;
+ }
grpc_channel_args *coreChannelArgs = GRPCBuildChannelArgs([args copy]);
grpc_channel *unmanagedChannel =
grpc_secure_channel_create(_channelCreds, host.UTF8String, coreChannelArgs, NULL);