Skip to content

Commit

Permalink
[JENKINS-16845] Diagnostics.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Apr 3, 2013
1 parent 750da1a commit e172407
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/main/java/hudson/model/AbstractBuild.java
Expand Up @@ -213,7 +213,11 @@ public R getPreviousBuild() {

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;
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/hudson/model/AbstractProject.java
Expand Up @@ -1010,6 +1010,9 @@ public BuildAuthorizationToken getAuthToken() {

@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;
}
Expand Down

0 comments on commit e172407

Please sign in to comment.