Skip to content

Commit

Permalink
Fix the issue that it may panic when user try to list expired compone…
Browse files Browse the repository at this point in the history
…nt (#1391)
  • Loading branch information
lucklove authored May 28, 2021
1 parent d1734e3 commit 5928416
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/repository/v1_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,11 @@ func (r *V1Repository) updateComponentManifest(id string, withYanked bool) (*v1m

if oldVersion != 0 && oldVersion == fileVersion.Version {
// We're up to date, load the old manifest from disk.
return r.local.LoadComponentManifest(&item, filename)
comp, err := r.local.LoadComponentManifest(&item, filename)
if comp == nil && err == nil {
err = fmt.Errorf("component %s does not exist", id)
}
return comp, err
}

var component v1manifest.Component
Expand Down

0 comments on commit 5928416

Please sign in to comment.