revid: fix nil dereference panic

This commit is contained in:
Dan Kortschak 2018-06-13 12:41:59 +09:30
parent 9d6836f585
commit f953216f31
1 changed files with 1 additions and 0 deletions

View File

@ -124,6 +124,7 @@ func newHttpSender(url string, timeout time.Duration, log func(lvl, msg string))
} }
func (s *httpSender) load(c *ring.Chunk) error { func (s *httpSender) load(c *ring.Chunk) error {
s.chunk = c
buf := bytes.NewBuffer(s.buf[:0]) buf := bytes.NewBuffer(s.buf[:0])
_, err := s.chunk.WriteTo(buf) _, err := s.chunk.WriteTo(buf)
s.buf = buf.Bytes() s.buf = buf.Bytes()