Remove nil filenames from database and indexes (fixes #1243)

This commit is contained in:
Jakob Borg
2015-01-07 15:44:36 +01:00
parent ce86131d12
commit e4837f14b1
2 changed files with 35 additions and 2 deletions

View File

@@ -586,6 +586,16 @@ func ldbWithAllFolderTruncated(db *leveldb.DB, folder []byte, fn func(device []b
if err != nil {
panic(err)
}
if f.Name == "" {
l.Infoln("Dropping invalid nil filename from database")
batch := new(leveldb.Batch)
ldbRemoveFromGlobal(db, batch, folder, device, nil)
batch.Delete(dbi.Key())
db.Write(batch, nil)
continue
}
if cont := fn(device, f); !cont {
return
}