From 31f36935d34167106c2d5317d75a2f49e31c78c7 Mon Sep 17 00:00:00 2001 From: GJ Date: Sun, 7 Apr 2013 09:01:12 -0400 Subject: [PATCH] Avoid NPE when using experience commands on offline players. --- .../gmail/nossr50/commands/experience/ExperienceCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java b/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java index 03d8838d7..b0d686c9e 100644 --- a/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java +++ b/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(); }