From a058990075b9cc59ee3c72589cf6ee265d22e037 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 16 Dec 2016 14:17:54 +0100 Subject: [PATCH] Fixed usernames NPE --- src/main/java/buttondevteam/chat/ChatPlayer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/buttondevteam/chat/ChatPlayer.java b/src/main/java/buttondevteam/chat/ChatPlayer.java index 058026a..fccb9bd 100644 --- a/src/main/java/buttondevteam/chat/ChatPlayer.java +++ b/src/main/java/buttondevteam/chat/ChatPlayer.java @@ -1,5 +1,6 @@ package buttondevteam.chat; +import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -21,7 +22,10 @@ public class ChatPlayer extends TBMCPlayer { } public List getUserNames() { - return getData(); + final List data = getData(); + if (data == null) + setUserNames(new ArrayList()); + return data; } public void setUserNames(List names) {