diff --git a/src/compiler/cpp_plugin.cc b/src/compiler/cpp_plugin.cc index 57f25a1f75f..acbe128213a 100644 --- a/src/compiler/cpp_plugin.cc +++ b/src/compiler/cpp_plugin.cc @@ -58,6 +58,11 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { return false; } + if (file->service_count() == 0) { + // No services. Do nothing. + return true; + } + grpc_cpp_generator::Parameters generator_parameters; if (!parameter.empty()) {