Skip to content

Commit

Permalink
Fix NPE in V3808
Browse files Browse the repository at this point in the history
The armor items may not exist, so we need to null check it.

(cherry picked from commit e7384ef)
  • Loading branch information
Spottedleaf authored and mworzala committed Jul 25, 2024
1 parent 90b9027 commit 1208975
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ public MapType<String> convert(final MapType<String> data, final long sourceVers

if (this.clearArmor) {
final ListType armor = data.getList("ArmorItems", ObjectType.MAP);
if (armor.size() > 2) {
if (armor != null && armor.size() > 2) {
armor.setMap(2, data.getTypeUtil().createEmptyMap());
}

final ListType chances = data.getList("ArmorDropChances", ObjectType.FLOAT);
if (chances.size() > 2) {
if (chances != null && chances.size() > 2) {
chances.setFloat(2, 0.085F);
}
}
Expand Down

0 comments on commit 1208975

Please sign in to comment.