From 9307898d8441500b11fd23c8d50d577c4959c60b Mon Sep 17 00:00:00 2001 From: ArcticZeroo Date: Sun, 7 Jan 2018 13:06:37 -0500 Subject: [PATCH] Fix rank bonus page error when user has <6 entries --- .../mineplex/staffServer/ui/rank/SupportRankBonusPage.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/rank/SupportRankBonusPage.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/rank/SupportRankBonusPage.java index 2307bfe0e..c90a58cf4 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/rank/SupportRankBonusPage.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/rank/SupportRankBonusPage.java @@ -50,9 +50,14 @@ public class SupportRankBonusPage extends SupportPage private ItemStack getLogIcon() { - int entries = 6; + int entries = Math.min(6, getBonusLog().size()); ItemBuilder builder = new ItemBuilder(Material.SIGN).setTitle(C.cGreenB + "Last " + entries + " Entries").addLore(""); + if (entries == 0) + { + builder.addLore(C.mBody + "No entries to display."); + } + for (int i = 0; i < entries; i++) { BonusEntry entry = getBonusLog().get(i);