mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-05 15:01:46 +01:00
Fix null check
This commit is contained in:
parent
60385c0887
commit
0cef390ff2
@ -176,11 +176,13 @@ public final class NBTUtils {
|
||||
break;
|
||||
}
|
||||
|
||||
AttributeSlot attributeSlot = AttributeSlot.valueOf(slot.toUpperCase());
|
||||
// Wrong attribute slot, stop here
|
||||
|
||||
if (attributeSlot == null)
|
||||
// Find slot, default to the main hand if the nbt tag is invalid
|
||||
AttributeSlot attributeSlot;
|
||||
try {
|
||||
attributeSlot = AttributeSlot.valueOf(slot.toUpperCase());
|
||||
} catch (IllegalArgumentException e) {
|
||||
attributeSlot = AttributeSlot.MAINHAND;
|
||||
}
|
||||
|
||||
// Add attribute
|
||||
final ItemAttribute itemAttribute =
|
||||
|
Loading…
Reference in New Issue
Block a user