archiver: Check that saved file does not have null IDs in content
Null IDs in the file content indicate that something went wrong. Thus fails before saving the affected file.
This commit is contained in:
parent
24a2e5cab9
commit
b1d1202b1d
3 changed files with 12 additions and 2 deletions
|
@ -1969,7 +1969,7 @@ type failSaveRepo struct {
|
|||
func (f *failSaveRepo) SaveBlob(ctx context.Context, t restic.BlobType, buf []byte, id restic.ID, storeDuplicate bool) (restic.ID, bool, int, error) {
|
||||
val := atomic.AddInt32(&f.cnt, 1)
|
||||
if val >= f.failAfter {
|
||||
return restic.ID{}, false, 0, f.err
|
||||
return restic.Hash(buf), false, 0, f.err
|
||||
}
|
||||
|
||||
return f.Repository.SaveBlob(ctx, t, buf, id, storeDuplicate)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue