Fix crash when obtaining owner from an unbound bindable item (#1205)

This commit is contained in:
Nicholas Ignoffo 2018-02-05 17:56:06 -08:00
parent e79f6c44d6
commit 27e41e2e77

View file

@ -25,11 +25,11 @@ public class ItemBindable extends Item implements IBindable {
@Override
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
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;
}
}