diff --git a/proto.go b/proto.go index e649574..e3721e4 100644 --- a/proto.go +++ b/proto.go @@ -57,6 +57,8 @@ func (c *protoCodec) ReadBody(conn io.Reader, b interface{}) error { buf, err := ioutil.ReadAll(conn) if err != nil { return err + } else if buf == nil { + return nil } return proto.Unmarshal(buf, m) }