diff --git a/src/main/java/me/waterarchery/litsellchest/models/SellTask.java b/src/main/java/me/waterarchery/litsellchest/models/SellTask.java index 24ff6fa..d11b0a0 100644 --- a/src/main/java/me/waterarchery/litsellchest/models/SellTask.java +++ b/src/main/java/me/waterarchery/litsellchest/models/SellTask.java @@ -68,8 +68,8 @@ public void run() { } public void handleSelling(SellChest sellChest) { - boolean isSellWithLore = LitSellChest.getInstance().getConfig().getBoolean("SellOnlyItemsWithLore"); boolean notifyOnUnsellable = ConfigHandler.getInstance().getConfig().getYml().getBoolean("NotSellingNotification", true); + new BukkitRunnable() { @Override public void run() { @@ -137,8 +137,12 @@ public void run() { } } if(hasInvalids && notifyOnUnsellable) { - String msg = configHandler.getMessageLang("InvalidPriceOrFree"); - messageHandler.sendMessage(player,msg); + Player player = Bukkit.getPlayer(sellChest.getOwner()); + + if (player != null) { + String msg = configHandler.getMessageLang("InvalidPriceOrFree"); + messageHandler.sendMessage(player, msg); + } } } else {