diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributeRemoveCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributeRemoveCommand.java index ab822fc2..0edd3b73 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributeRemoveCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributeRemoveCommand.java @@ -56,7 +56,15 @@ public class AttributeRemoveCommand extends SWCommand { public void genericCommand(Player player, @Mapper("attribute") String attribute) { ItemStack itemStack = player.getInventory().getItemInMainHand(); ItemMeta itemMeta = itemStack.getItemMeta(); + if (itemMeta == null) { + BauSystem.MESSAGE.send("ATTRIBUTE_REMOVE_NOT_FOUND", player); + return; + } List lore = itemMeta.getLore(); + if (lore == null) { + BauSystem.MESSAGE.send("ATTRIBUTE_REMOVE_NOT_FOUND", player); + return; + } if (lore.isEmpty()) { BauSystem.MESSAGE.send("ATTRIBUTE_REMOVE_NOT_FOUND", player); return; @@ -83,7 +91,9 @@ public class AttributeRemoveCommand extends SWCommand { Player player = (Player) commandSender; ItemStack itemStack = player.getInventory().getItemInMainHand(); ItemMeta itemMeta = itemStack.getItemMeta(); + if (itemMeta == null) return null; List lore = itemMeta.getLore(); + if (lore == null) return null; if (lore.isEmpty()) return null; if (!lore.get(0).equals("§eAttributes§8:")) return null; return lore.stream()