Merge pull request #1185 from prattmic/gcs_panic

gs: fix nil dereference
This commit is contained in:
Alexander Neumann 2017-08-28 21:11:30 +02:00
commit 4118ce876e

View file

@ -223,9 +223,14 @@ func (be *Backend) Save(ctx context.Context, h restic.Handle, rd io.Reader) (err
}).Media(rd).Do()
be.sem.ReleaseToken()
debug.Log("%v -> %v bytes, err %#v: %v", objName, info.Size, err, err)
return errors.Wrap(err, "service.Objects.Insert")
if err != nil {
debug.Log("%v: err %#v: %v", objName, err, err)
return errors.Wrap(err, "service.Objects.Insert")
}
debug.Log("%v -> %v bytes", objName, info.Size)
return nil
}
// wrapReader wraps an io.ReadCloser to run an additional function on Close.