Fixed usernames NPE

This commit is contained in:
Norbi Peti 2016-12-16 14:17:54 +01:00
parent a2ad97faec
commit a058990075

View file

@ -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<String> getUserNames() {
return getData();
final List<String> data = getData();
if (data == null)
setUserNames(new ArrayList<String>());
return data;
}
public void setUserNames(List<String> names) {