From 4469637f275a9a433d7c9a99bda6b99ca4ad32c1 Mon Sep 17 00:00:00 2001 From: bm01 Date: Sun, 8 Jul 2012 00:02:40 +0200 Subject: [PATCH] NPE prevention for Users.getProfile() --- src/main/java/com/gmail/nossr50/util/Users.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/util/Users.java b/src/main/java/com/gmail/nossr50/util/Users.java index ec6b7d0ff..dbda26f14 100644 --- a/src/main/java/com/gmail/nossr50/util/Users.java +++ b/src/main/java/com/gmail/nossr50/util/Users.java @@ -97,7 +97,9 @@ public class Users { * @return the player's profile */ public static PlayerProfile getProfile(String playerName) { - return players.get(playerName).getProfile(); + McMMOPlayer mcmmoPlayer = players.get(playerName); + + return (mcmmoPlayer != null) ? mcmmoPlayer.getProfile() : null; } /**