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

check if null in getItemMeta

This commit is contained in:
Josh 2020-06-12 17:29:04 -04:00 committed by GitHub
parent 6bc28d6b69
commit 56bd432719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,7 +45,11 @@ public final class ItemStackWrapper extends ItemStack {
// Since this class is immutable, we can simply let the super class create one copy
// and then store that instead of creating a clone everytime.
// This will significantly speed up any loop comparisons if used correctly.
return meta;
if (meta == null) {
throw new UnsupportedOperationException("#hasItemMeta() must be checked prior to this call");
} else {
return meta;
}
}
@Override