mirror of https://github.com/restic/restic.git
Add additional check
This commit is contained in:
parent
d2cda159e1
commit
13fc9fe604
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue