From cb3332a9cb8724acd4655490a0b58f58d859f28e Mon Sep 17 00:00:00 2001 From: Logan Barrett Date: Sun, 1 Sep 2019 23:22:39 +0000 Subject: [PATCH] Update SellerMinion.java --- .../minionsplus/model/minions/SellerMinion.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/me/loganb1max/minionsplus/model/minions/SellerMinion.java b/src/main/java/me/loganb1max/minionsplus/model/minions/SellerMinion.java index b05c0bd..77f114e 100644 --- a/src/main/java/me/loganb1max/minionsplus/model/minions/SellerMinion.java +++ b/src/main/java/me/loganb1max/minionsplus/model/minions/SellerMinion.java @@ -50,11 +50,15 @@ public class SellerMinion extends Minion { for (int i = 0; i < chest.getInventory().getSize(); i++) { final ItemStack item = chest.getInventory().getItem(i); if (item == null || item.getType() == Material.AIR) continue; - double sellPrice = MinionsPlus.getEssentials().getWorth().getPrice(MinionsPlus.getEssentials(), item).doubleValue(); - if (sellPrice <= 0) continue; - MinionsPlus.getEcon().depositPlayer(Bukkit.getOfflinePlayer(getOwner()), sellPrice * item.getAmount()); - chest.getInventory().setItem(i, new ItemStack(Material.AIR)); - sold = true; + try { + double sellPrice = MinionsPlus.getEssentials().getWorth().getPrice(MinionsPlus.getEssentials(), item).doubleValue(); + if (sellPrice <= 0) continue; + MinionsPlus.getEcon().depositPlayer(Bukkit.getOfflinePlayer(getOwner()), sellPrice * item.getAmount()); + chest.getInventory().setItem(i, new ItemStack(Material.AIR)); + sold = true; + } catch(final Exception e) { + Bukkit.getLogger().info("SELLER MINION ERROR: Price not found for " + item.toString()); + } } } }