Skip to content

Commit

Permalink
return error if layers is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
axtloss authored Apr 26, 2024
1 parent fff6607 commit bbfc020
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ func (r *Registry) GetManifest(token string) (*Manifest, error) {
digest := resp.Header.Get("Docker-Content-Digest")

// we need to parse the layers to get the digests
if m["layers"] == nil {
PrintVerboseErr("Registry.GetManifest", 4, err)
return nil, fmt.Errorf("Manifest does not contain layer property")
}
layers := m["layers"].([]interface{})
var layerDigests []string
for _, layer := range layers {
Expand Down

0 comments on commit bbfc020

Please sign in to comment.