diff --git a/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java b/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java index a69d116..b55ce74 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java +++ b/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java @@ -19,6 +19,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.EnchantmentStorageMeta; import org.maxgamer.quickshop.QuickShop; +import org.maxgamer.quickshop.Shop.ContainerShop; import org.maxgamer.quickshop.Shop.Shop; @SuppressWarnings("deprecation") @@ -143,7 +144,7 @@ public class MsgUtil { p.sendMessage(""); p.sendMessage(ChatColor.DARK_PURPLE + "+---------------------------------------------------+"); p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.getMessage("menu.shop-information")); - p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.getMessage("menu.owner", Bukkit.getOfflinePlayer(shop.getOwner()).getName())); + p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.getMessage("menu.owner", Bukkit.getOfflinePlayer(shop.getOwner())==null ? (shop.isUnlimited() ? "AdminShop" : "Unknown") : Bukkit.getOfflinePlayer(shop.getOwner()).getName())); p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.getMessage("menu.item", shop.getDataName())); if (Util.isTool(items.getType())) { p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.getMessage("menu.damage-percent-remaining", Util.getToolPercentage(items))); @@ -276,7 +277,7 @@ public class MsgUtil { return raw; } for (int i = 0; i < args.length; i++) { - raw = raw.replace("{" + i + "}", args[i]); //TODO Nullpointer? + raw = raw.replace("{" + i + "}", args[i]==null ? "null" : args[i]); } return raw; }