avoid nil exception

fix https://github.com/chrislusf/seaweedfs/issues/1869
This commit is contained in:
Chris Lu 2021-03-07 01:49:06 -08:00
parent 1bd880dcdb
commit bdfed16d42

View file

@ -152,9 +152,11 @@ func (m *LevelDbNeedleMap) Close() {
glog.Warningf("close index file %s failed: %v", indexFileName, err)
}
if m.db != nil {
if err := m.db.Close(); err != nil {
glog.Warningf("close levelDB failed: %v", err)
}
}
}
func (m *LevelDbNeedleMap) Destroy() error {