fix gprc_cli segfault when using binary in and out (#31411)

pull/31019/head^2
Micah Paul Ramos 2 years ago committed by GitHub
parent 29175b97ee
commit 1f0c6a6748
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      test/cpp/util/grpc_tool.cc

@ -562,7 +562,8 @@ bool GrpcTool::CallMethod(int argc, const char** argv,
request_text = argv[2];
}
if (parser->IsStreaming(method_name, true /* is_request */)) {
if (parser != nullptr &&
parser->IsStreaming(method_name, true /* is_request */)) {
std::istream* input_stream;
std::ifstream input_file;
@ -666,7 +667,8 @@ bool GrpcTool::CallMethod(int argc, const char** argv,
} else { // parser->IsStreaming(method_name, true /* is_request */)
if (absl::GetFlag(FLAGS_batch)) {
if (parser->IsStreaming(method_name, false /* is_request */)) {
if (parser != nullptr &&
parser->IsStreaming(method_name, false /* is_request */)) {
fprintf(stderr, "Batch mode for streaming RPC is not supported.\n");
return false;
}

Loading…
Cancel
Save