From 9558618182aa817ad5aa9885f1fe12003ee1a93e Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 6 Nov 2018 11:37:41 -0800 Subject: [PATCH] Check if call is cancelled --- src/objective-c/GRPCClient/GRPCCall.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index 5ce361300d6..1338c1edd60 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -237,7 +237,9 @@ const char *kCFStreamVarName = "grpc_cfstream"; - (void)writeData:(NSData *)data { dispatch_async(_dispatchQueue, ^{ - [self->_pipe writeValue:data]; + if (self->_call) { + [self->_pipe writeValue:data]; + } }); }