Skip to content

Commit

Permalink
Fix NPE in get package by name (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
olevitt authored Jun 24, 2024
1 parent b3c2a99 commit 2fea9d3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ public abstract class CatalogWrapper {
private Map<String, List<Chart>> entries = Map.of();

public Optional<Chart> getPackageByName(String name) {
return entries.get(name).stream().findFirst();
if (entries.containsKey(name)) {
return entries.get(name).stream().findFirst();
} else {
return Optional.empty();
}
}

public Optional<Chart> getPackageByNameAndVersion(String name, String version) {
Expand Down

0 comments on commit 2fea9d3

Please sign in to comment.