summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2019-01-09 09:58:04 +0100
committerGitHub <noreply@github.com>2019-01-09 09:58:04 +0100
commit5251626df44e98457ea111f440d9a79cb6033075 (patch)
treecd3e6f1d4d316014dcfe3264c19e10a6f19d2b56
parent7b3b7973e5a52114892a11724d633ff1dad4330a (diff)
parentca1f29707cc2d04b559499fb2a155812c3286848 (diff)
Merge pull request #8067 from vespa-engine/jvensatd/badges
Fix list length check
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java
index c80130f8937..5c56c7d2280 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java
@@ -324,8 +324,8 @@ public class JobController {
public URI historicBadge(ApplicationId id, JobType type, int historyLength) {
List<Run> runs = new ArrayList<>(runs(id, type).values());
Run lastCompleted = null;
- if (runs.size() == 1)
- lastCompleted = runs.get(0);
+ if (runs.size() > 0)
+ lastCompleted = runs.get(runs.size() - 1);
if (runs.size() > 1 && ! lastCompleted.hasEnded())
lastCompleted = runs.get(runs.size() - 2);