1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

add check

This commit is contained in:
Josh 2020-06-12 18:10:06 -04:00 committed by GitHub
parent 5f8ae4b182
commit a232d82851
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,9 @@ public class CustomItemDataService implements PersistentDataService, Keyed {
} }
public Optional<String> getItemData(ItemStack item) { public Optional<String> getItemData(ItemStack item) {
if (!item.hasItemMeta()) {
return Optional.empty();
}
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
if (meta == null) { if (meta == null) {
return Optional.empty(); return Optional.empty();