Skip to content

Commit

Permalink
[JENKINS-33859] NPE Error updating JIRA issues - Added NP check after
Browse files Browse the repository at this point in the history
retrieving the issue.
  • Loading branch information
alvarolobato committed Mar 29, 2016
1 parent e23c778 commit 8c914f1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/main/java/hudson/plugins/jira/Updater.java
Expand Up @@ -18,6 +18,7 @@
import java.util.logging.Logger;
import org.apache.commons.lang.StringUtils;
import com.atlassian.jira.rest.client.api.RestClientException;
import com.atlassian.jira.rest.client.api.domain.Issue;
import com.google.common.base.Strings;
import hudson.Util;
import hudson.model.Hudson;
Expand Down Expand Up @@ -204,8 +205,16 @@ private static List<JiraIssue> getJiraIssues(
}
continue; // token looked like a JIRA issue but it's actually not.
}

issues.add(new JiraIssue(session.getIssue(id)));

Issue issue = session.getIssue(id);
if (issue == null) {
if (debug) {
logger.println(id + " issue doesn't exist in JIRA");
}
continue;
}

issues.add(new JiraIssue(issue));
}
return issues;
}
Expand Down

0 comments on commit 8c914f1

Please sign in to comment.