NPE prevention for Users.getProfile()

This commit is contained in:
bm01 2012-07-08 00:02:40 +02:00
parent f4ecbe7f65
commit 4469637f27

View File

@ -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;
} }
/** /**