[gRPC ObjC] Adding strong self nullability check (#27236)

pull/27269/head
Denny C. Dai 3 years ago committed by GitHub
parent 1568b9cb6c
commit 94bf58735d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      src/objective-c/GRPCClient/private/GRPCCore/GRPCWrappedCall.m

@ -143,9 +143,11 @@
__weak typeof(self) weakSelf = self;
_handler = ^{
__strong typeof(self) strongSelf = weakSelf;
NSDictionary *metadata =
[NSDictionary grpc_dictionaryFromMetadataArray:strongSelf->_headers];
handler(metadata);
if (strongSelf) {
NSDictionary *metadata =
[NSDictionary grpc_dictionaryFromMetadataArray:strongSelf->_headers];
handler(metadata);
}
};
}
}
@ -175,7 +177,9 @@
__weak typeof(self) weakSelf = self;
_handler = ^{
__strong typeof(self) strongSelf = weakSelf;
handler(strongSelf->_receivedMessage);
if (strongSelf) {
handler(strongSelf->_receivedMessage);
}
};
}
}

Loading…
Cancel
Save