diff --git a/test/cpp/util/grpc_tool.cc b/test/cpp/util/grpc_tool.cc index 84846d741a8..1c3dbedd161 100644 --- a/test/cpp/util/grpc_tool.cc +++ b/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; }