diff --git a/toml.go b/toml.go index 54bcad5..fbfb4fe 100644 --- a/toml.go +++ b/toml.go @@ -64,6 +64,8 @@ func (c *tomlCodec) ReadBody(conn io.Reader, b interface{}) error { buf, err := ioutil.ReadAll(conn) if err != nil { return err + } else if buf == nil { + return nil } return toml.Unmarshal(buf, b)