From eb37ae24fa02a4e15760a9d2487e1d8f47c100d1 Mon Sep 17 00:00:00 2001 From: icicle1133 Date: Mon, 7 Sep 2026 10:14:59 -0500 Subject: [PATCH] Fixed 26_2to26_1 protocol predicate can be null, and then .remove() causes an error when joining from older clients --- .../protocol/v26_2to26_1/Protocol26_2To26_1.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/v26_2to26_1/Protocol26_2To26_1.java b/common/src/main/java/com/viaversion/viabackwards/protocol/v26_2to26_1/Protocol26_2To26_1.java index 869009eab..e788a38f6 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/v26_2to26_1/Protocol26_2To26_1.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/v26_2to26_1/Protocol26_2To26_1.java @@ -74,9 +74,12 @@ public void updateEnchantmentTerm(final CompoundTag term) { final String condition = term.getString("condition"); if (Key.equals(condition, "entity_properties")) { final CompoundTag predicate = term.getCompoundTag("predicate"); - final Tag typeTag = predicate.remove("entity_type"); - if (typeTag != null) { - predicate.put("type", typeTag); + + if (predicate != null) { + final Tag typeTag = predicate.remove("entity_type"); + if (typeTag != null) { + predicate.put("type", typeTag); + } } } } @@ -194,4 +197,4 @@ protected PacketTypesProvider