ouch. this bug hurts.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3016 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-04-11 05:47:44 +00:00
1 parent e95bd4fb6f
commit d26c38ebfd
1 file changed
+1 -1
+1 -1
View File
@@ -330,7 +330,7 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
* gone (deleted, rotated, etc.)
*/
public final RunT getNearestBuild(int n) {
SortedMap<Integer, ? extends RunT> m = _getRuns().headMap(n);
SortedMap<Integer, ? extends RunT> m = _getRuns().headMap(n-1); // the map should include n, so n-1
if(m.isEmpty()) return null;
return m.get(m.lastKey());
}