Skip to content

Commit dd526d1

Browse files
mawinter69timja
andauthored
Avoid NPE in Job#getLastBuildsOverThreshold (#26005)
Co-authored-by: Tim Jacomb <[email protected]>
1 parent a96ecf8 commit dd526d1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/main/java/hudson/model/Job.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,6 +1053,9 @@ public RunT getLastCompletedBuild() {
10531053
*/
10541054
public List<RunT> getLastBuildsOverThreshold(int numberOfBuilds, Result threshold) {
10551055
RunT r = getLastBuild();
1056+
if (r == null) {
1057+
return Collections.emptyList();
1058+
}
10561059
return r.getBuildsOverThreshold(numberOfBuilds, threshold);
10571060
}
10581061

0 commit comments

Comments
 (0)