Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 b7bdae1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/hudson/maven/MavenBuild.java
Expand Up @@ -750,8 +750,11 @@ listener,new ProxyImpl(),
}

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);
}
}
}

}
Expand Down

0 comments on commit b7bdae1

Please sign in to comment.