mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-03 01:19:58 +01:00
Throw meaningful exception when item not found
This commit is contained in:
parent
85111f25cb
commit
1e381a59be
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user