Skip to content

Commit

Permalink
Merge 3.0.x into Freeze
Browse files Browse the repository at this point in the history
Merge 3.0.x into Freeze
  • Loading branch information
azoitl authored Sep 20, 2024
2 parents db8f26c + 86b3490 commit d1e68d5
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -953,8 +953,9 @@ private static LibraryRecord getLibraryRecord(final Map<String, List<LibraryReco
*/
private static LibraryRecord getLibraryRecord(final Map<String, List<LibraryRecord>> libs,
final String symbolicName, final VersionRange range) {
return libs.get(symbolicName).stream().filter(l -> range.includes(l.version()))
.sorted((o1, o2) -> o2.version().compareTo(o1.version())).findFirst().orElse(null);
return libs.getOrDefault(symbolicName, Collections.emptyList()).stream()
.filter(l -> range.includes(l.version())).sorted((o1, o2) -> o2.version().compareTo(o1.version()))
.findFirst().orElse(null);
}

/**
Expand All @@ -967,7 +968,7 @@ private static LibraryRecord getLibraryRecord(final Map<String, List<LibraryReco
*/
private static LibraryRecord getLibraryRecord(final Map<String, List<LibraryRecord>> libs,
final String symbolicName, final java.net.URI uri) {
return libs.get(symbolicName).stream().filter(l -> l.uri().equals(uri))
return libs.getOrDefault(symbolicName, Collections.emptyList()).stream().filter(l -> l.uri().equals(uri))
.sorted((o1, o2) -> o2.version().compareTo(o1.version())).findFirst().orElse(null);
}

Expand Down

0 comments on commit d1e68d5

Please sign in to comment.