Require owner to be non-null. It should never be null

This commit is contained in:
tastybento 2021-10-11 17:56:06 -07:00
parent 37e7846908
commit 1a802a7510

View File

@ -36,7 +36,7 @@ public class CommandCycleClick implements ClickHandler {
// Get the user's island for the game world // Get the user's island for the game world
World world = panel.getWorld().orElse(user.getWorld()); World world = panel.getWorld().orElse(user.getWorld());
Island island = plugin.getIslands().getIsland(world, user.getUniqueId()); Island island = plugin.getIslands().getIsland(world, user.getUniqueId());
if (island != null && island.getOwner().equals(user.getUniqueId())) { if (island != null && island.getOwner() != null && island.getOwner().equals(user.getUniqueId())) {
RanksManager rm = plugin.getRanksManager(); RanksManager rm = plugin.getRanksManager();
int currentRank = island.getRankCommand(command); int currentRank = island.getRankCommand(command);
if (click.equals(ClickType.LEFT)) { if (click.equals(ClickType.LEFT)) {