소스 검색

Avoid NPE when using experience commands on offline players.

GJ 12 년 전
부모
커밋
31f36935d3
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java

+ 1 - 1
src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java

@@ -58,7 +58,6 @@ public abstract class ExperienceCommand implements CommandExecutor {
                 }
 
                 mcMMOPlayer = UserManager.getPlayer(args[0]);
-                player = mcMMOPlayer.getPlayer();
 
                 // If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
                 if (mcMMOPlayer == null) {
@@ -73,6 +72,7 @@ public abstract class ExperienceCommand implements CommandExecutor {
                 }
                 else {
                     profile = mcMMOPlayer.getProfile();
+                    player = mcMMOPlayer.getPlayer();
                     editValues();
                 }