Skip to content

Commit

Permalink
BLADE-743 cli: ReleaseUtil: fixes NPE during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbrokke committed Apr 4, 2024
1 parent 04366d5 commit ca75729
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cli/src/main/java/com/liferay/blade/cli/util/ReleaseUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
public class ReleaseUtil {

public static ReleaseEntry getReleaseEntry(String releaseKey) {
if (_releaseUtil == null) {
populateReleases(7);
}

return _releaseUtil._releaseEntryMap.getOrDefault(releaseKey, _EMPTY_RELEASE_ENTRY);
}

Expand All @@ -31,6 +35,10 @@ public static void populateReleases(int maxAge) {
}

public static Stream<ReleaseEntry> releaseEntriesStream() {
if (_releaseUtil == null) {
populateReleases(7);
}

return _releaseUtil._releaseEntries.stream();
}

Expand Down

0 comments on commit ca75729

Please sign in to comment.