diff --git a/pkg/repo/index.go b/pkg/repo/index.go index e1ce3c62d..a93314ab8 100644 --- a/pkg/repo/index.go +++ b/pkg/repo/index.go @@ -357,6 +357,7 @@ func loadIndex(data []byte, source string) (*IndexFile, error) { for idx := len(cvs) - 1; idx >= 0; idx-- { if cvs[idx] == nil { log.Printf("skipping loading invalid entry for chart %q from %s: empty entry", name, source) + cvs = append(cvs[:idx], cvs[idx+1:]...) continue } // When metadata section missing, initialize with no data diff --git a/pkg/repo/index_test.go b/pkg/repo/index_test.go index a1e3e9438..1fb30f3c0 100644 --- a/pkg/repo/index_test.go +++ b/pkg/repo/index_test.go @@ -68,6 +68,7 @@ entries: grafana: - apiVersion: v2 name: grafana + - null foo: - bar: