Skip to content

Commit

Permalink
mvcc/backend: check for nil boltOpenOptions
Browse files Browse the repository at this point in the history
Check if boltOpenOptions is nil before use it.
  • Loading branch information
jingyih committed Feb 15, 2020
1 parent 74cfe52 commit b6ee807
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mvcc/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit b6ee807

Please sign in to comment.