From cd9dc1195e46777610d72157db1b6a345f8aa8cd Mon Sep 17 00:00:00 2001 From: Nicko Guyer Date: Fri, 10 Nov 2023 16:40:07 -0500 Subject: [PATCH] Additional nil check on CallRPC Signed-off-by: Nicko Guyer --- pkg/rpcbackend/backend.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/rpcbackend/backend.go b/pkg/rpcbackend/backend.go index d165de9c..23f19020 100644 --- a/pkg/rpcbackend/backend.go +++ b/pkg/rpcbackend/backend.go @@ -128,7 +128,7 @@ func (rc *RPCClient) CallRPC(ctx context.Context, result interface{}, method str } res, err := rc.SyncRequest(ctx, rpcReq) if err != nil { - if res.Error != nil && res.Error.Code != 0 { + if res != nil && res.Error != nil && res.Error.Code != 0 { return res.Error } return &RPCError{Code: int64(RPCCodeInternalError), Message: err.Error()}