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.
  • Loading branch information
Spottedleaf committed Jun 16, 2024
1 parent 34582ce commit e7384ef
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 e7384ef

Please sign in to comment.