mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-25 18:48:15 +01:00
Prevent NPE on null items- though not sure how it gets here.
This commit is contained in:
parent
c847fd0c37
commit
b623f5eec8
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user