content: fix panic during filepath.Walk()

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda 2017-02-06 05:16:21 +00:00
parent deaa17b3c4
commit e9510eb69c
1 changed files with 3 additions and 0 deletions

View File

@ -173,6 +173,9 @@ func (cs *Store) Walk(fn WalkFunc) error {
root := filepath.Join(cs.root, "blobs")
var alg digest.Algorithm
return filepath.Walk(root, func(path string, fi os.FileInfo, err error) error {
if err != nil {
return err
}
if !fi.IsDir() && !alg.Available() {
return nil
}