aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-06-27 14:03:28 +0300
committerGravatar Vitaly Takmazov2016-06-27 14:03:28 +0300
commit8ecdfbd5a36c7cc4d48bb563c9b561a904033514 (patch)
tree1d356b655dda74f7f0e7f4f77632adb5c3c99c41 /src/main/java/com
parent2dd92ddd6596bc1237b5b9559397dd68ff0be2df (diff)
fixes
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/juick/http/www/User.java3
1 files changed, 2 insertions, 1 deletions
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<Tag> 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 = "<a href=\"./?tag=" + URLEncoder.encode(tags.get(i).Name, "UTF-8") + "\" title=\""