[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [metrics-web/master] Fix a bug in displaying older news.
commit 1cf0103c8545004aea844eb1b08f56d738da8d90
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
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<>();
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits