Skip to content

Commit

Permalink
Don't try to interpret null as an enum
Browse files Browse the repository at this point in the history
This should help with #9
  • Loading branch information
davenonymous committed Feb 5, 2022
1 parent 6bcbabc commit b0d5667
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down Expand Up @@ -412,4 +414,4 @@ public interface NbtReader<T extends Object> {
T read(String key, CompoundTag tag, T original);
}

}
}

0 comments on commit b0d5667

Please sign in to comment.