Check if Power Player data is loaded before acting on it

Steps to reproduce:
1) Join before server has started up
This commit is contained in:
samczsun 2017-02-26 13:42:26 -05:00 committed by cnr
parent ed25fe1341
commit c4bb9a23d5

View File

@ -170,7 +170,8 @@ public class PowerPlayClubButton implements GuiItem
public static boolean isAvailable(Player player, PowerPlayClubRepository repo)
{
return !repo.getCachedData(player).getUnclaimedMonths().isEmpty();
PowerPlayData data = repo.getCachedData(player);
return data != null && !data.getUnclaimedMonths().isEmpty();
}
}