dont fail empty payload

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-04-12 16:42:06 +03:00
parent 549ab44fa0
commit bd5c06922d

View File

@ -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)
}