mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
mvcc/backend: check for nil boltOpenOptions
Check if boltOpenOptions is nil before use it.
This commit is contained in:
parent
74cfe52809
commit
b6ee807e93
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user