1
0
mirror of https://e.coding.net/circlecloud/QuickShop.git synced 2024-12-29 08:08:49 +00:00

Fixed NullPointerException (bugfix #6)

This commit is contained in:
KaiKikuchi 2015-08-29 01:05:46 +02:00
parent 33d7258275
commit d6fcf0f15e

View File

@ -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;
}