Fix crash when obtaining owner from an unbound bindable item (#1205)
This commit is contained in:
parent
e79f6c44d6
commit
27e41e2e77
|
@ -25,11 +25,11 @@ public class ItemBindable extends Item implements IBindable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getOwnerName(ItemStack stack) {
|
public String getOwnerName(ItemStack stack) {
|
||||||
return !stack.isEmpty() ? stack.getTagCompound().getString(Constants.NBT.OWNER_NAME) : null;
|
return !stack.isEmpty() && stack.hasTagCompound() ? stack.getTagCompound().getString(Constants.NBT.OWNER_NAME) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getOwnerUUID(ItemStack stack) {
|
public String getOwnerUUID(ItemStack stack) {
|
||||||
return !stack.isEmpty() ? stack.getTagCompound().getString(Constants.NBT.OWNER_UUID) : null;
|
return !stack.isEmpty() && stack.hasTagCompound() ? stack.getTagCompound().getString(Constants.NBT.OWNER_UUID) : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue