This commit is contained in:
crusader 2017-11-29 01:31:09 +09:00
parent c0fdabe039
commit 4f15515a83

View File

@ -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 { func (src *ServerRequestCodec) writeServerResponse(w io.Writer, res *serverResponse) error {
// ID is null for notifications and they don't have a response. // 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)) encoder := json.NewEncoder(src.codec.Encode(w))
// Not sure in which case will this happen. But seems harmless. // Not sure in which case will this happen. But seems harmless.
if err := encoder.Encode(res); nil != err { if err := encoder.Encode(res); nil != err {