Fix panic on nil index writer

pull/5805/head
Simon Pasquier 2018-01-24 15:55:04 +01:00
parent 467948f3c3
commit 5d47710f8a
1 changed files with 1 additions and 1 deletions

View File

@ -428,10 +428,10 @@ func (c *LeveledCompactor) write(dest string, meta *BlockMeta, blocks ...BlockRe
}
indexw, err := index.NewWriter(filepath.Join(tmp, indexFilename))
meta.Version = indexw.Version
if err != nil {
return errors.Wrap(err, "open index writer")
}
meta.Version = indexw.Version
if err := c.populateBlock(blocks, meta, indexw, chunkw); err != nil {
return errors.Wrap(err, "write compaction")