mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-19 23:57:43 +01:00
Fixed NPE in PlayerInteractEvent regarding infinite stack removal.
This commit is contained in:
parent
e957f92496
commit
cf5a5b5b47
@ -330,7 +330,7 @@ public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
&& !plugin.hasPermission(player, "worldguard.override.infinite-stack")) {
|
||||
int slot = player.getInventory().getHeldItemSlot();
|
||||
ItemStack heldItem = player.getInventory().getItem(slot);
|
||||
if (heldItem.getAmount() < 0) {
|
||||
if (heldItem != null && heldItem.getAmount() < 0) {
|
||||
player.getInventory().setItem(slot, null);
|
||||
player.sendMessage(ChatColor.RED + "Infinite stack removed.");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user