[tor-commits] [metrics-web/master] Fix a bug in displaying older news.
karsten at torproject.org
karsten at torproject.org
Mon Aug 28 13:42:01 UTC 2017
commit 1cf0103c8545004aea844eb1b08f56d738da8d90
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date: Mon Aug 28 15:41:25 2017 +0200
Fix a bug in displaying older news.
---
website/src/main/java/org/torproject/metrics/web/NewsServlet.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/website/src/main/java/org/torproject/metrics/web/NewsServlet.java b/website/src/main/java/org/torproject/metrics/web/NewsServlet.java
index 3df80d0..6dfaba7 100644
--- a/website/src/main/java/org/torproject/metrics/web/NewsServlet.java
+++ b/website/src/main/java/org/torproject/metrics/web/NewsServlet.java
@@ -78,7 +78,8 @@ public class NewsServlet extends AnyServlet {
String year = String.format("%tY", cal);
cutOffDates.put(yearStart, new String[] { year, year });
} while (!this.sortedNews.isEmpty()
- && yearStart.compareTo(this.sortedNews.get(0).getStart()) > 0);
+ && yearStart.compareTo(this.sortedNews.get(this.sortedNews.size() - 1)
+ .getStart()) > 0);
/* Sort news into categories. */
Map<String[], List<String[]>> newsByCategory = new LinkedHashMap<>();
More information about the tor-commits
mailing list