mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Avoid NPE when using experience commands on offline players.
This commit is contained in:
parent
a14fc3e3c9
commit
31f36935d3
@ -58,7 +58,6 @@ public abstract class ExperienceCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mcMMOPlayer = UserManager.getPlayer(args[0]);
|
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 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) {
|
if (mcMMOPlayer == null) {
|
||||||
@ -73,6 +72,7 @@ public abstract class ExperienceCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
profile = mcMMOPlayer.getProfile();
|
profile = mcMMOPlayer.getProfile();
|
||||||
|
player = mcMMOPlayer.getPlayer();
|
||||||
editValues();
|
editValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user