Skip to content

Commit

Permalink
dont fail empty payload
Browse files Browse the repository at this point in the history
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
  • Loading branch information
vtolstov committed Apr 12, 2021
1 parent 549ab44 commit bd5c069
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit bd5c069

Please sign in to comment.