From cb22a88ba3c865823d9d4e58ab03af8384c667e0 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 26 Feb 2020 21:34:40 +0300 Subject: [PATCH] various fixes (#1267) * logger: remove Panic log level Signed-off-by: Vasiliy Tolstov * server/grpc: add missing Unlock in Subscribe error Signed-off-by: Vasiliy Tolstov * server: minor code change Signed-off-by: Vasiliy Tolstov * server/grpc: extend test suite with pub/sub testing Signed-off-by: Vasiliy Tolstov * server/grpc: fix invalid check and allow subscriber error to be returned Signed-off-by: Vasiliy Tolstov * server/grpc: add pubsub tests Signed-off-by: Vasiliy Tolstov * client/grpc: check for nil req/rsp Signed-off-by: Vasiliy Tolstov --- grpc.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/grpc.go b/grpc.go index 0905eac..42e7101 100644 --- a/grpc.go +++ b/grpc.go @@ -383,6 +383,11 @@ func (g *grpcClient) NewRequest(service, method string, req interface{}, reqOpts } func (g *grpcClient) Call(ctx context.Context, req client.Request, rsp interface{}, opts ...client.CallOption) error { + if req == nil { + return errors.InternalServerError("go.micro.client", "req is nil") + } else if rsp == nil { + return errors.InternalServerError("go.micro.client", "rsp is nil") + } // make a copy of call opts callOpts := g.opts.CallOptions for _, opt := range opts {