提交 5d32d495 编写于 作者: J Jesse Glick

getTransientActions should defend against null members even when assertions are disabled.

Cf.: https://github.com/jenkinsci/remote-terminal-access-plugin/commit/db24e2126b649689652ac8ddb100f3ef6680a422
上级 ebccc6a3
......@@ -359,8 +359,13 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
public List<Action> getTransientActions() {
List<Action> actions = new ArrayList<Action>();
for (TransientBuildActionFactory factory: TransientBuildActionFactory.all()) {
actions.addAll(factory.createFor(this));
assert !actions.contains(null) : "null action added by " + factory;
for (Action created : factory.createFor(this)) {
if (created == null) {
LOGGER.log(WARNING, "null action added by {0}", factory);
continue;
}
actions.add(created);
}
}
return Collections.unmodifiableList(actions);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册