Validate parameters of GRPCChannelConfiguration:initWithHost:

pull/16190/head
Muxi Yan 6 years ago
parent dcf5f1ff38
commit 4efa40d7cd
  1. 2
      src/objective-c/GRPCClient/private/GRPCChannelPool.m

@ -35,6 +35,8 @@ extern const char *kCFStreamVarName;
@implementation GRPCChannelConfiguration @implementation GRPCChannelConfiguration
- (nullable instancetype)initWithHost:(NSString *)host callOptions:(GRPCCallOptions *)callOptions { - (nullable instancetype)initWithHost:(NSString *)host callOptions:(GRPCCallOptions *)callOptions {
NSAssert(host.length, @"Host must not be empty.");
NSAssert(callOptions, @"callOptions must not be empty.");
if ((self = [super init])) { if ((self = [super init])) {
_host = [host copy]; _host = [host copy];
_callOptions = [callOptions copy]; _callOptions = [callOptions copy];

Loading…
Cancel
Save