From 82d298ab371b1a94c42929f3029ff511c9a3847c Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 9 Sep 2012 06:36:14 +0100 Subject: If chat event doesn't resolve to valid player, cancel and exit. --- .../essentials/chat/EssentialsChatPlayerListenerLowest.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'EssentialsChat') diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java index 410dc3b3b..e8fee2fbb 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java @@ -32,6 +32,12 @@ public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer } final User user = ess.getUser(event.getPlayer()); + + if (user == null) { + event.setCancelled(true); + return; + } + final ChatStore chatStore = new ChatStore(ess, user, getChatType(event.getMessage())); setChatStore(event, chatStore); -- cgit v1.2.3