diff options
author | Muxi Yan <mxyan@google.com> | 2018-12-07 16:01:23 -0800 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2018-12-07 16:01:23 -0800 |
commit | df21aab3a6af360cff29a5164f9728ba646d35ab (patch) | |
tree | 31b4ad23e2fbcf7964ea4036cc87e440d7990492 /src/objective-c/ProtoRPC/ProtoRPC.m | |
parent | 92db5fc72488f9d62b81ee311a79832df787f3ef (diff) |
nullability annotation
Diffstat (limited to 'src/objective-c/ProtoRPC/ProtoRPC.m')
-rw-r--r-- | src/objective-c/ProtoRPC/ProtoRPC.m | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/objective-c/ProtoRPC/ProtoRPC.m b/src/objective-c/ProtoRPC/ProtoRPC.m index 92d7fce33c..15b0f681ce 100644 --- a/src/objective-c/ProtoRPC/ProtoRPC.m +++ b/src/objective-c/ProtoRPC/ProtoRPC.m @@ -57,6 +57,9 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing responseClass:(Class)responseClass { NSAssert(message != nil, @"message cannot be empty."); NSAssert(responseClass != nil, @"responseClass cannot be empty."); + if (message == nil || responseClass == nil) { + return nil; + } if ((self = [super init])) { _call = [[GRPCStreamingProtoCall alloc] initWithRequestOptions:requestOptions responseHandler:handler |