Navigation Menu

Skip to content

Commit

Permalink
Ignore null reporters field and avoid a NPE.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
oldelvet committed Aug 26, 2011
1 parent 8dfa5e1 commit 2fa4018
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions maven-plugin/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 2fa4018

Please sign in to comment.