From 8ecdfbd5a36c7cc4d48bb563c9b561a904033514 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 27 Jun 2016 14:03:28 +0300 Subject: fixes --- src/main/java/com/juick/http/www/User.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/com/juick/http/www/User.java b/src/main/java/com/juick/http/www/User.java index d0c1aaee..51b3965f 100644 --- a/src/main/java/com/juick/http/www/User.java +++ b/src/main/java/com/juick/http/www/User.java @@ -322,7 +322,8 @@ public class User { List tags = TagQueries.getUserTagsAll(sql, user.getUID()); int maxUsageCnt = tags.stream().map(t -> t.UsageCnt).max(Integer::max).get(); String ret = ""; - for (int i = 0; i < cnt; i++) { + int count = Math.min(tags.size(), cnt); + for (int i = 0; i < count; i++) { String tag = Utils.encodeHTML(tags.get(i).Name); try { tag = "