Merge pull request #11630 from jingyih/check_nil_before_use_boltOpenOptions

mvcc/backend: check for nil boltOpenOptions
This commit is contained in:
Jingyi Hu 2020-02-15 15:25:44 +08:00 committed by GitHub
commit f0faa5501d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
}