diff --git a/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java b/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java index c4fc9e26d..8108bb75f 100644 --- a/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java +++ b/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java @@ -714,7 +714,10 @@ private int execute(CliRequest cliRequest) throws MavenExecutionRequestPopulatio logSummary(summary, references, "", cliRequest.showErrors); if (exception instanceof LifecycleExecutionException) { - failedProjects.add(((LifecycleExecutionException) exception).getProject()); + MavenProject project = ((LifecycleExecutionException) exception).getProject(); + if (project != null) { + failedProjects.add(project); + } } }