Fix rank bonus page error when user has <6 entries

This commit is contained in:
ArcticZeroo 2018-01-07 13:06:37 -05:00 committed by Alexander Meech
parent dc3c4d6850
commit 9307898d84

View File

@ -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);