Fixed a rare crash

This commit is contained in:
LemADEC 2016-08-07 18:20:06 +02:00
parent 8480bbe715
commit 78f318c9dd

View file

@ -624,6 +624,10 @@ public class WarpDrive implements LoadingCallback {
}
public static void addChatMessage(final ICommandSender sender, final String message) {
if (sender == null) {
logger.error("Unable to send message to NULL sender: " + message);
return;
}
String[] lines = message.replace("§", "" + (char)167).replace("\\n", "\n").split("\n");
for (String line : lines) {
sender.addChatMessage(new ChatComponentText(line));