diff --git a/src/main/java/com/davenonymous/libnonymous/serialization/nbt/NBTFieldHandlers.java b/src/main/java/com/davenonymous/libnonymous/serialization/nbt/NBTFieldHandlers.java index 4449bbd..b4f10bd 100644 --- a/src/main/java/com/davenonymous/libnonymous/serialization/nbt/NBTFieldHandlers.java +++ b/src/main/java/com/davenonymous/libnonymous/serialization/nbt/NBTFieldHandlers.java @@ -83,8 +83,10 @@ public class NBTFieldHandlers { return null; }), (key, anEnum, tag) -> { CompoundTag result = new CompoundTag(); - result.putString("class", anEnum.getClass().getName()); - result.putString("value", anEnum.name()); + if(anEnum != null) { + result.putString("class", anEnum.getClass().getName()); + result.putString("value", anEnum.name()); + } tag.put(key, result); }); @@ -412,4 +414,4 @@ public interface NbtReader { T read(String key, CompoundTag tag, T original); } -} +} \ No newline at end of file