aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/ProtoRPC/ProtoRPC.m
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-10-19 15:42:39 -0700
committerGravatar Muxi Yan <mxyan@google.com>2018-10-19 15:43:21 -0700
commit422d3296b2d4fb3f8aa0991c2ffa895251ad8e91 (patch)
tree6ebfe78c33a6164ad3330e6926a11adcef375bf5 /src/objective-c/ProtoRPC/ProtoRPC.m
parente542e006eb4ffcd0c19488428a3cfe5605bf41e5 (diff)
Annotate Nullability
Diffstat (limited to 'src/objective-c/ProtoRPC/ProtoRPC.m')
-rw-r--r--src/objective-c/ProtoRPC/ProtoRPC.m14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/objective-c/ProtoRPC/ProtoRPC.m b/src/objective-c/ProtoRPC/ProtoRPC.m
index 44e9bfde0a..f6e3298f62 100644
--- a/src/objective-c/ProtoRPC/ProtoRPC.m
+++ b/src/objective-c/ProtoRPC/ProtoRPC.m
@@ -34,7 +34,7 @@
- (instancetype)initWithRequestOptions:(GRPCRequestOptions *)requestOptions
message:(GPBMessage *)message
responseHandler:(id<GRPCProtoResponseHandler>)handler
- callOptions:(GRPCCallOptions *)callOptions
+ callOptions:(GRPCCallOptions * _Nullable)callOptions
responseClass:(Class)responseClass {
if ((self = [super init])) {
_call = [[GRPCStreamingProtoCall alloc] initWithRequestOptions:requestOptions
@@ -70,7 +70,7 @@
- (instancetype)initWithRequestOptions:(GRPCRequestOptions *)requestOptions
responseHandler:(id<GRPCProtoResponseHandler>)handler
- callOptions:(GRPCCallOptions *)callOptions
+ callOptions:(GRPCCallOptions * _Nullable)callOptions
responseClass:(Class)responseClass {
if (requestOptions.host.length == 0 || requestOptions.path.length == 0) {
[NSException raise:NSInvalidArgumentException format:@"Neither host nor path can be nil."];
@@ -153,8 +153,8 @@
});
}
-- (void)receivedInitialMetadata:(NSDictionary *)initialMetadata {
- if (_handler) {
+- (void)receivedInitialMetadata:(NSDictionary * _Nullable)initialMetadata {
+ if (_handler && initialMetadata != nil) {
id<GRPCProtoResponseHandler> handler = _handler;
if ([handler respondsToSelector:@selector(initialMetadata:)]) {
dispatch_async(handler.dispatchQueue, ^{
@@ -164,8 +164,8 @@
}
}
-- (void)receivedRawMessage:(NSData *)message {
- if (_handler) {
+- (void)receivedRawMessage:(NSData * _Nullable)message {
+ if (_handler && message != nil) {
id<GRPCProtoResponseHandler> handler = _handler;
NSError *error = nil;
GPBMessage *parsed = [_responseClass parseFromData:message error:&error];
@@ -188,7 +188,7 @@
}
}
-- (void)closedWithTrailingMetadata:(NSDictionary *)trailingMetadata error:(NSError *)error {
+- (void)closedWithTrailingMetadata:(NSDictionary * _Nullable)trailingMetadata error:(NSError * _Nullable)error {
if (_handler) {
id<GRPCProtoResponseHandler> handler = _handler;
if ([handler respondsToSelector:@selector(closedWithTrailingMetadata:error:)]) {