aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient/GRPCCall.m
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-11-06 10:15:20 -0800
committerGravatar Muxi Yan <mxyan@google.com>2018-11-06 10:51:06 -0800
commit6b8f0ceae8f581cfd63b40c4e2ccab95783081ae (patch)
tree4c4cc199363c987e2f4bae1dee9038d18944b853 /src/objective-c/GRPCClient/GRPCCall.m
parent17a67fdb0fb01fe34c75d2c6bf34e24214222a89 (diff)
A few nits
Diffstat (limited to 'src/objective-c/GRPCClient/GRPCCall.m')
-rw-r--r--src/objective-c/GRPCClient/GRPCCall.m9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m
index 2abc0fe8f3..2f727e62be 100644
--- a/src/objective-c/GRPCClient/GRPCCall.m
+++ b/src/objective-c/GRPCClient/GRPCCall.m
@@ -67,6 +67,7 @@ const char *kCFStreamVarName = "grpc_cfstream";
@implementation GRPCRequestOptions
- (instancetype)initWithHost:(NSString *)host path:(NSString *)path safety:(GRPCCallSafety)safety {
+ NSAssert(host.length != 0 && path.length != 0, @"Host and Path cannot be empty");
if ((self = [super init])) {
_host = [host copy];
_path = [path copy];
@@ -90,7 +91,7 @@ const char *kCFStreamVarName = "grpc_cfstream";
/** The handler of responses. */
id<GRPCResponseHandler> _handler;
- // Thread safety of ivars below are protected by _dispatcheQueue.
+ // Thread safety of ivars below are protected by _dispatchQueue.
/**
* Make use of legacy GRPCCall to make calls. Nullified when call is finished.
@@ -121,7 +122,11 @@ const char *kCFStreamVarName = "grpc_cfstream";
if ((self = [super init])) {
_requestOptions = [requestOptions copy];
- _callOptions = [callOptions copy];
+ if (callOptions == nil) {
+ _callOptions = [[GRPCCallOptions alloc] init];
+ } else {
+ _callOptions = [callOptions copy];
+ }
_handler = responseHandler;
_initialMetadataPublished = NO;
_pipe = [GRXBufferedPipe pipe];