Skip to content

Commit

Permalink
[JENKINS-16845] Properly report the IllegalStateException, rather tha…
Browse files Browse the repository at this point in the history
…n throwing an NPE producing the exception message.

java.lang.NullPointerException
	at hudson.model.Run.getFullDisplayName(Run.java:711)
	at hudson.model.Run.toString(Run.java:706)
	at java.lang.String.valueOf(Unknown Source)
	at java.lang.StringBuilder.append(Unknown Source)
	at hudson.model.AbstractBuild.getPreviousBuild(AbstractBuild.java:218)
  • Loading branch information
jglick committed Jun 12, 2013
1 parent acf8884 commit cc26f23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/AbstractBuild.java
Expand Up @@ -217,7 +217,7 @@ public R getPreviousBuild() {
// having two neighbors pointing to each other is important to make RunMap.removeValue work
P _parent = getParent();
if (_parent == null) {
throw new IllegalStateException("no parent for " + this);
throw new IllegalStateException("no parent for " + number + " in " + workspace);
}
R pb = _parent._getRuns().search(number-1, Direction.DESC);
if (pb!=null) {
Expand Down

0 comments on commit cc26f23

Please sign in to comment.