mirror of
https://github.com/octoleo/restic.git
synced 2024-11-25 14:17:42 +00:00
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()
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
return Blob{}, err
|
||||
|
Loading…
Reference in New Issue
Block a user