Skip to content

Commit

Permalink
Merge pull request #30624 from aloubyansky/all-projects-npe
Browse files Browse the repository at this point in the history
Fix NPE obtaining a project map from Maven session
  • Loading branch information
gsmet authored Jan 26, 2023
2 parents 1ac3b96 + 85bcb2e commit 503ff88
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ static ArtifactKey getProjectId(MavenProject project) {

static Map<Path, Model> getProjectMap(MavenSession session) {
final List<MavenProject> allProjects = session.getAllProjects();
if (allProjects == null) {
return Map.of();
}
final Map<Path, Model> projectModels = new HashMap<>(allProjects.size());
for (MavenProject mp : allProjects) {
mp.getOriginalModel().setPomFile(mp.getFile());
Expand Down

0 comments on commit 503ff88

Please sign in to comment.