diff --git a/protocol/json/server_request.go b/protocol/json/server_request.go index db9d221..ed294d4 100644 --- a/protocol/json/server_request.go +++ b/protocol/json/server_request.go @@ -167,7 +167,7 @@ func (src *ServerRequestCodec) WriteError(w io.Writer, status int, err error) er func (src *ServerRequestCodec) writeServerResponse(w io.Writer, res *serverResponse) error { // ID is null for notifications and they don't have a response. - if req.ID != nil { + if res.ID != nil { encoder := json.NewEncoder(src.codec.Encode(w)) // Not sure in which case will this happen. But seems harmless. if err := encoder.Encode(res); nil != err {