From c96b2bd859910ba07b711b4298bf35181fad09da Mon Sep 17 00:00:00 2001 From: RK_01 <50594595+RaphiMC@users.noreply.github.com> Date: Fri, 2 Sep 2022 16:00:45 +0200 Subject: [PATCH] Fix 1.19 -> 1.18.2 title translation: empty text edge case (#3115) --- .../protocols/protocol1_19to1_18_2/Protocol1_19To1_18_2.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/Protocol1_19To1_18_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/Protocol1_19To1_18_2.java index 03ed4b904..e0918ccd3 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/Protocol1_19To1_18_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/Protocol1_19To1_18_2.java @@ -120,7 +120,8 @@ public final class Protocol1_19To1_18_2 extends AbstractProtocol { final JsonElement component = wrapper.read(Type.COMPONENT); - if (!component.isJsonNull()) { + final boolean isEmpty = component.isJsonNull() || (component.isJsonArray() && component.getAsJsonArray().size() == 0); + if (!isEmpty) { wrapper.write(Type.COMPONENT, component); } else { wrapper.write(Type.COMPONENT, GsonComponentSerializer.gson().serializeToTree(Component.empty()));