提交 0c76f85f 编写于 作者: O Oleg Nenashev

Merge pull request #1248 from daniel-beck/JENKINS-20499

[JENKINS-20499] Don't fail horribly with null causes
......@@ -101,8 +101,10 @@ public class CauseAction implements FoldableAction, RunAction2 {
public Map<Cause,Integer> getCauseCounts() {
Map<Cause,Integer> result = new LinkedHashMap<Cause,Integer>();
for (Cause c : causes) {
Integer i = result.get(c);
result.put(c, i == null ? 1 : i.intValue() + 1);
if (c != null) {
Integer i = result.get(c);
result.put(c, i == null ? 1 : i.intValue() + 1);
}
}
return result;
}
......@@ -120,7 +122,8 @@ public class CauseAction implements FoldableAction, RunAction2 {
if (owner instanceof AbstractBuild) { // cf. onAttached
AbstractBuild<?,?> b = (AbstractBuild) owner;
for (Cause c : causes) {
c.onLoad(b);
if (c != null)
c.onLoad(b);
}
}
}
......@@ -132,7 +135,8 @@ public class CauseAction implements FoldableAction, RunAction2 {
if (owner instanceof AbstractBuild) {// this should be always true but being defensive here
AbstractBuild b = (AbstractBuild) owner;
for (Cause c : causes) {
c.onAddedTo(b);
if (c != null)
c.onAddedTo(b);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册