Skip to content
Permalink
Browse files
[JENKINS-16845] Properly report the IllegalStateException, rather tha…
…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 cc26f23ec4f7ba58577c490b35e4c481d0527f49
Showing with 1 addition and 1 deletion.
  1. +1 −1 core/src/main/java/hudson/model/AbstractBuild.java
@@ -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) {

0 comments on commit cc26f23

Please sign in to comment.