소스 검색

Don't process chat if the mcMMOPlayer is null.

The player should ALWAYS be online when chatting, but depending on
external plugins and applications, this is not always properly
implemented. Fixes #1578
GJ 12 년 전
부모
커밋
6d5f3a52f4
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      src/main/java/com/gmail/nossr50/listeners/PlayerListener.java

+ 7 - 0
src/main/java/com/gmail/nossr50/listeners/PlayerListener.java

@@ -619,6 +619,13 @@ public class PlayerListener implements Listener {
         }
 
         McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player, true);
+        
+        if (mcMMOPlayer == null) {
+            mcMMO.p.debug(player.getName() + "is chatting, but is currently not logged in to the server.");
+            mcMMO.p.debug("Party & Admin chat will not work properly for this player.");
+            return;
+        }
+
         ChatManager chatManager = null;
 
         if (mcMMOPlayer.getPartyChatMode()) {