From 3fc55638f91c4e53be0aa315e7fa877c4a923edc Mon Sep 17 00:00:00 2001 From: Gerrygames Date: Tue, 22 Jan 2019 20:33:39 +0100 Subject: [PATCH] fix NPE --- .../protocol1_12_2to1_13/packets/PlayerPacket1_13.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/packets/PlayerPacket1_13.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/packets/PlayerPacket1_13.java index f2240384..32fb8399 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/packets/PlayerPacket1_13.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/packets/PlayerPacket1_13.java @@ -119,12 +119,12 @@ public class PlayerPacket1_13 extends Rewriter { //TODO team color/prefix handling changed from 1.12.2 to 1.13 and to 1.13.1 again afaik String prefix = wrapper.read(Type.STRING); String suffix = wrapper.read(Type.STRING); - prefix = ChatRewriter.jsonTextToLegacy(prefix); + prefix = prefix == null ? "" : ChatRewriter.jsonTextToLegacy(prefix); prefix += "§" + (colour > -1 && colour <= 15 ? Integer.toHexString(colour) : "r"); prefix = ChatUtil.removeUnusedColor(prefix, 'f', true); if (prefix.length() > 16) prefix = prefix.substring(0, 16); if (prefix.endsWith("§")) prefix = prefix.substring(0, prefix.length() - 1); - suffix = ChatRewriter.jsonTextToLegacy(suffix); + suffix = suffix == null ? "" : ChatRewriter.jsonTextToLegacy(suffix); suffix = ChatUtil.removeUnusedColor(suffix, 'f'); if (suffix.endsWith("§")) suffix = suffix.substring(0, suffix.length() - 1); wrapper.write(Type.STRING, prefix);