diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index b04ada85a..0259331c3 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -430,7 +430,7 @@ public class EssentialsPlayerListener extends PlayerListener } User user = User.get(event.getPlayer()); ItemStack is = user.getItemInHand(); - if (is.getType() == Material.AIR) { + if (is == null || is.getType() == Material.AIR) { return; } String command = user.getPowertool(is); diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index d7a6ff2e2..12f294dc7 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -287,7 +287,7 @@ public abstract class UserData extends PlayerExtension implements IConf { savedInventory = is; config.setProperty("inventory.size", is.length); for (int i = 0; i < is.length; i++) { - if (is[i].getType() == Material.AIR) { + if (is[i] == null || is[i].getType() == Material.AIR) { continue; } config.setProperty("inventory."+i, is[i]); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java index 480097ca3..9489d4a1e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java @@ -16,7 +16,7 @@ public class Commandpowertool extends EssentialsCommand { protected void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception { ItemStack is = user.getItemInHand(); - if (is.getType() == Material.AIR) { + if (is == null || is.getType() == Material.AIR) { user.sendMessage("Command can't be attached to air."); } String command = getFinalArg(args, 0);