Skip to content

Commit

Permalink
Merge pull request #1 from avdv/fix-npe-jenkins-27418
Browse files Browse the repository at this point in the history
Avoid NPE in ScoverageProjectAction.doDynamic
  • Loading branch information
shanbin committed Mar 17, 2015
2 parents b3c814b + 42eb91c commit 94eedc0
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,14 @@ public TrendGraph getTrendGraph() {

public DirectoryBrowserSupport doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, InterruptedException {
if (project.getLastBuild() != null && getDisplayName() != null) {
String url = getLastSuccessfulBuildAction().getUrlName();
FilePath path = new FilePath(project.getLastBuild().getRootDir()).child(url);
return new DirectoryBrowserSupport(this, path, "Scoverage HTML Report", "", false);
} else {
return null;
ScoverageBuildAction lastSuccessfulAction = getLastSuccessfulBuildAction();
if (lastSuccessfulAction != null) {
String url = lastSuccessfulAction.getUrlName();
FilePath path = new FilePath(project.getLastBuild().getRootDir()).child(url);

return new DirectoryBrowserSupport(this, path, "Scoverage HTML Report", "", false);
}
}
return null;
}
}

0 comments on commit 94eedc0

Please sign in to comment.