2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-29 08:14:03 +00:00

Add additional check

This commit is contained in:
Alexander Neumann 2014-12-01 00:06:29 +01:00
parent d2cda159e1
commit 13fc9fe604

View File

@ -487,6 +487,13 @@ func (arch *Archiver) saveTree(t *Tree) (Blob, error) {
wg.Wait() wg.Wait()
// check for invalid file nodes
for _, node := range *t {
if node.Type == "file" && node.Content == nil {
return Blob{}, fmt.Errorf("node %v has empty content", node.Name)
}
}
blob, err := arch.SaveJSON(backend.Tree, t) blob, err := arch.SaveJSON(backend.Tree, t)
if err != nil { if err != nil {
return Blob{}, err return Blob{}, err