From 78f318c9dd1fc48a86be0ecc739da3b689f30101 Mon Sep 17 00:00:00 2001 From: LemADEC Date: Sun, 7 Aug 2016 18:20:06 +0200 Subject: [PATCH] Fixed a rare crash --- src/main/java/cr0s/warpdrive/WarpDrive.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/cr0s/warpdrive/WarpDrive.java b/src/main/java/cr0s/warpdrive/WarpDrive.java index fcc54b74..f4fbe318 100644 --- a/src/main/java/cr0s/warpdrive/WarpDrive.java +++ b/src/main/java/cr0s/warpdrive/WarpDrive.java @@ -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));