Skip to content

Commit

Permalink
[FIXED JENKINS-41311] Fix NPE in CleanupJobsOnDelete.onDeleted
Browse files Browse the repository at this point in the history
  • Loading branch information
abayer committed Feb 24, 2017
1 parent 3ba2edb commit 7ecb946
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -345,9 +345,12 @@ public static class CleanupJobsOnDelete extends ItemListener {
public void onDeleted(Item item) {
if (item instanceof Job) {
String jobName = item.getFullName();
Map<Integer, Milestone> job = getMilestonesByOrdinalByJob().get(jobName);
if (job != null) {
remove(jobName);
Map<String, Map<Integer, Milestone>> milestones = getMilestonesByOrdinalByJob();
if (milestones != null) {
Map<Integer, Milestone> job = getMilestonesByOrdinalByJob().get(jobName);
if (job != null) {
remove(jobName);
}
}
}
}
Expand Down

0 comments on commit 7ecb946

Please sign in to comment.