Skip to content
Permalink
Browse files

Ignore null reporters field and avoid a NPE.

The NPE can occur if a build fails during checkout and hence the run phase
never gets called. See JENKINS-10831 for an example of this happening.
(cherry picked from commit 2fa4018)
  • Loading branch information
oldelvet authored and vjuranek committed Feb 2, 2012
1 parent bafad70 commit d630404282c993756497d2adf884413d87b89cc4
Showing with 5 additions and 2 deletions.
  1. +5 −2 maven-plugin/src/main/java/hudson/maven/MavenBuild.java
@@ -752,8 +752,11 @@ protected Result doRun(BuildListener listener) throws Exception {
}

public void post2(BuildListener listener) throws Exception {
for (MavenReporter reporter : reporters)
reporter.end(MavenBuild.this,launcher,listener);
if (reporters != null) {
for (MavenReporter reporter : reporters) {
reporter.end(MavenBuild.this,launcher,listener);
}
}
}

}

0 comments on commit d630404

Please sign in to comment.
You can’t perform that action at this time.