Skip to content

Commit

Permalink
Fix JENKINS-14338
Browse files Browse the repository at this point in the history
Added check to see if AbstractProject is null before trying to use it.
  • Loading branch information
slide committed Oct 12, 2013
1 parent 7ba282f commit a8280bc
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -521,7 +521,9 @@ private MimeMessage createMail(EmailType type, AbstractBuild<?, ?> build, BuildL
Cause.UpstreamCause upc = build.getCause(Cause.UpstreamCause.class);
while (upc != null) {
// UpstreamCause.getUpStreamProject() returns the full name, so use getItemByFullName
AbstractProject<?, ?> p = (AbstractProject<?, ?>) Hudson.getInstance().getItemByFullName(upc.getUpstreamProject());
AbstractProject<?, ?> p = (AbstractProject<?, ?>) Jenkins.getInstance().getItemByFullName(upc.getUpstreamProject());
if(p == null)
break;
cur = p.getBuildByNumber(upc.getUpstreamBuild());
upc = cur.getCause(Cause.UpstreamCause.class);
}
Expand Down

0 comments on commit a8280bc

Please sign in to comment.