mvcc/backend: check for nil boltOpenOptions

Check if boltOpenOptions is nil before use it.
This commit is contained in:
jingyih 2020-02-14 21:26:52 -08:00
parent 74cfe52809
commit b6ee807e93

View File

@ -365,7 +365,10 @@ func (b *backend) defrag() error {
if err != nil {
return err
}
options := *boltOpenOptions
options := bolt.Options{}
if boltOpenOptions != nil {
options = *boltOpenOptions
}
options.OpenFile = func(path string, i int, mode os.FileMode) (file *os.File, err error) {
return temp, nil
}