Throw meaningful exception when item not found

This commit is contained in:
md678685 2018-10-13 16:32:21 +01:00
parent 85111f25cb
commit 1e381a59be

View File

@ -101,7 +101,12 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb {
@Override
public ItemStack get(final String id) throws Exception {
ItemData data = Objects.requireNonNull(getByName(id));
ItemData data = getByName(id);
if (data == null) {
throw new Exception(tl("unknownItemName", id));
}
PotionData potionData = data.getPotionData();
Material material = data.getMaterial();