From 5a217fcb7013b2f1be617334fb168bc17766f7b8 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 4 Nov 2017 19:59:08 +0100 Subject: [PATCH] Added an important null check --- src/main/java/buttondevteam/chat/ChatProcessing.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/buttondevteam/chat/ChatProcessing.java b/src/main/java/buttondevteam/chat/ChatProcessing.java index 2022a09..55c8aa9 100644 --- a/src/main/java/buttondevteam/chat/ChatProcessing.java +++ b/src/main/java/buttondevteam/chat/ChatProcessing.java @@ -269,7 +269,7 @@ public class ChatProcessing { int len = name.length() / clrs.length; val nclar = ChatPlayer.getPlayer(player.getUniqueId(), ChatPlayer.class).NameColorLocations().get(); int[] ncl = nclar == null ? null : nclar.stream().mapToInt(Integer::intValue).toArray(); - if (Arrays.stream(ncl).sum() != name.length() || ncl.length != clrs.length) + if (ncl != null && Arrays.stream(ncl).sum() != name.length() || ncl.length != clrs.length) ncl = null; // Reset if name length changed if (name.charAt(0) == '~') { // Ignore ~ in nicknames prevlen.incrementAndGet();