From abe4aae40049ca73fb29ccf325cc3734408d9aae Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 29 Oct 2018 15:21:05 -0700 Subject: [PATCH] Remove length check in GRPCCall for backwards compatibility --- src/objective-c/GRPCClient/GRPCCall.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index 44432a120ac..ca2cdd6b312 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -391,7 +391,8 @@ const char *kCFStreamVarName = "grpc_cfstream"; callSafety:(GRPCCallSafety)safety requestsWriter:(GRXWriter *)requestWriter callOptions:(GRPCCallOptions *)callOptions { - if (host.length == 0 || path.length == 0) { + // Purposely using pointer rather than length ([host length] == 0) for backwards compatibility. + if (!host || !path) { [NSException raise:NSInvalidArgumentException format:@"Neither host nor path can be nil or empty."]; }