diff --git a/pkg/repo/index.go b/pkg/repo/index.go index 17d8d33e1..e1ce3c62d 100644 --- a/pkg/repo/index.go +++ b/pkg/repo/index.go @@ -353,10 +353,6 @@ func loadIndex(data []byte, source string) (*IndexFile, error) { return i, err } - if i.APIVersion == "" { - return i, ErrNoAPIVersion - } - for name, cvs := range i.Entries { for idx := len(cvs) - 1; idx >= 0; idx-- { if cvs[idx] == nil { @@ -379,6 +375,9 @@ func loadIndex(data []byte, source string) (*IndexFile, error) { i.Entries[name] = cvs } i.SortEntries() + if i.APIVersion == "" { + return i, ErrNoAPIVersion + } return i, nil }