mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
NPE prevention for Users.getProfile()
This commit is contained in:
parent
f4ecbe7f65
commit
4469637f27
@ -97,7 +97,9 @@ public class Users {
|
|||||||
* @return the player's profile
|
* @return the player's profile
|
||||||
*/
|
*/
|
||||||
public static PlayerProfile getProfile(String playerName) {
|
public static PlayerProfile getProfile(String playerName) {
|
||||||
return players.get(playerName).getProfile();
|
McMMOPlayer mcmmoPlayer = players.get(playerName);
|
||||||
|
|
||||||
|
return (mcmmoPlayer != null) ? mcmmoPlayer.getProfile() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user