提交 e172407b 编写于 作者: J Jesse Glick

[JENKINS-16845] Diagnostics.

上级 750da1a7
......@@ -213,7 +213,11 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
if (r==null) {
// having two neighbors pointing to each other is important to make RunMap.removeValue work
R pb = getParent().builds.search(number-1, Direction.DESC);
P _parent = getParent();
if (_parent == null) {
throw new IllegalStateException("no parent for " + this);
}
R pb = _parent._getRuns().search(number-1, Direction.DESC);
if (pb!=null) {
((AbstractBuild)pb).nextBuild = selfReference; // establish bi-di link
this.previousBuild = pb.selfReference;
......
......@@ -1010,6 +1010,9 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
@Override
public RunMap<R> _getRuns() {
if (builds == null) {
throw new IllegalStateException("no run map created yet for " + this);
}
assert builds.baseDirInitialized() : "neither onCreatedFromScratch nor onLoad called on " + this + " yet";
return builds;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册