From e7384ef22774f4331d0ebdb0e394ff0c2bc5f10c Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sat, 15 Jun 2024 22:06:59 -0700 Subject: [PATCH] Fix NPE in V3808 The armor items may not exist, so we need to null check it. --- .../spottedleaf/dataconverter/minecraft/versions/V3808.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3808.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3808.java index 22b7bf3..78a10f8 100644 --- a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3808.java +++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3808.java @@ -44,12 +44,12 @@ public MapType convert(final MapType 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); } }