summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-09-09 06:36:14 +0100
committerKHobbits <rob@khobbits.co.uk>2012-09-09 06:36:14 +0100
commitff0dd00d79df6129ee15ff2f674eeca43faeecc8 (patch)
tree239724f57a77481192064385e51e7b8f82b7c591
parente18d12f1090999bf930ac70d901679e9c1f0bbcd (diff)
downloadEssentials-ff0dd00d79df6129ee15ff2f674eeca43faeecc8.tar
Essentials-ff0dd00d79df6129ee15ff2f674eeca43faeecc8.tar.gz
Essentials-ff0dd00d79df6129ee15ff2f674eeca43faeecc8.tar.lz
Essentials-ff0dd00d79df6129ee15ff2f674eeca43faeecc8.tar.xz
Essentials-ff0dd00d79df6129ee15ff2f674eeca43faeecc8.zip
If chat event doesn't resolve to valid player, cancel and exit.
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java6
1 files changed, 6 insertions, 0 deletions
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);