mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-24 03:25:20 +01:00
Prevent NPE on null items- though not sure how it gets here.
This commit is contained in:
parent
65862a5bd1
commit
877b593e7e
@ -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