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.

Originally-Committed-As: 2fa40188b91bd0f55c611fbd0cb2878c8d55da55
  • Loading branch information
oldelvet committed Aug 26, 2011
1 parent 37baaba commit b7bdae110772e8972f561db154958a6bf7df8350
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/main/java/hudson/maven/MavenBuild.java
@@ -750,8 +750,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 b7bdae1

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