Skip to content

Commit

Permalink
Protect against null when no jobs are in a changelist.
Browse files Browse the repository at this point in the history
JENKINS-33993
  • Loading branch information
p4paul committed May 9, 2016
1 parent 6cfa721 commit bab531a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/main/java/org/jenkinsci/plugins/p4/changes/P4ChangeSet.java
Expand Up @@ -90,11 +90,14 @@ public static void store(File file, List<P4ChangeEntry> changes) {
stream.println("\t\t</files>");

stream.println("\t\t<jobs>");
for (IFix job : cl.getJobs()) {
String id = job.getJobId();
String status = job.getStatus();

stream.println("\t\t<job id=\"" + id + "\" status=\"" + status + "\" />");
List<IFix> jobs = cl.getJobs();
if (jobs != null) {
for (IFix job : jobs) {
String id = job.getJobId();
String status = job.getStatus();

stream.println("\t\t<job id=\"" + id + "\" status=\"" + status + "\" />");
}
}
stream.println("\t\t</jobs>");

Expand Down

0 comments on commit bab531a

Please sign in to comment.