Prevent NPE on null items- though not sure how it gets here.

This commit is contained in:
Nathan Wolf 2015-11-12 14:50:27 -08:00
parent 65862a5bd1
commit 877b593e7e

View File

@ -164,7 +164,9 @@ public class ItemUtil implements ColorUtil {
public static String getDisplayString(ItemStack is) { public static String getDisplayString(ItemStack is) {
String text; String text;
if (is == null) {
return null;
}
if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) { if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) {
text = "" + DARKAQUA + ITALIC + is.getItemMeta().getDisplayName() + RESET + AQUA + " x " + is.getAmount(); text = "" + DARKAQUA + ITALIC + is.getItemMeta().getDisplayName() + RESET + AQUA + " x " + is.getAmount();
} else { } else {