From eb687e6638e17d025bddc004bace989ec13a672e Mon Sep 17 00:00:00 2001 From: rtm516 Date: Sat, 28 Nov 2020 15:10:19 +0000 Subject: [PATCH] Add check to fix NONE team color causing an NPE (#1602) --- .../connector/network/translators/chat/MessageTranslator.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/chat/MessageTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/chat/MessageTranslator.java index c650e5823..79ce856ad 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/chat/MessageTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/chat/MessageTranslator.java @@ -234,6 +234,10 @@ public class MessageTranslator { * @return The chat color character */ public static String toChatColor(TeamColor teamColor) { + if (teamColor.equals(TeamColor.NONE)) { + return ""; + } + NamedTextColor textColor = NamedTextColor.NAMES.value(teamColor.name().toLowerCase()); if (textColor != null) { return getColor(textColor);