From 413077101eab400635732b813da4f1e4a5b69c5a Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 10 Oct 2018 18:10:21 -0700 Subject: [PATCH] requestOptions precondition check polishing --- src/objective-c/GRPCClient/GRPCCall.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index c0413ec6c2d..c9ee5084868 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -98,7 +98,7 @@ const char *kCFStreamVarName = "grpc_cfstream"; - (instancetype)initWithRequestOptions:(GRPCRequestOptions *)requestOptions responseHandler:(id)responseHandler callOptions:(GRPCCallOptions *)callOptions { - if (!requestOptions || !requestOptions.host || !requestOptions.path) { + if (requestOptions.host.length == 0 || requestOptions.path.length == 0) { [NSException raise:NSInvalidArgumentException format:@"Neither host nor path can be nil."]; }