summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-11-29 17:39:13 +0100
committersnowleo <schneeleo@gmail.com>2011-11-29 17:39:22 +0100
commit60067964befac36651a9f5f232652b1daf794c7b (patch)
treed0d58ce6e16f7c33b52d05ab29fe5678bbc7df0b
parent414d6b79e97ee41c94ad789a7c4aefd8bcbe5ea8 (diff)
downloadEssentials-60067964befac36651a9f5f232652b1daf794c7b.tar
Essentials-60067964befac36651a9f5f232652b1daf794c7b.tar.gz
Essentials-60067964befac36651a9f5f232652b1daf794c7b.tar.lz
Essentials-60067964befac36651a9f5f232652b1daf794c7b.tar.xz
Essentials-60067964befac36651a9f5f232652b1daf794c7b.zip
Fix NPE in getUser()
-rw-r--r--Essentials/src/com/earth2me/essentials/Essentials.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java
index 15419b014..e33e70f18 100644
--- a/Essentials/src/com/earth2me/essentials/Essentials.java
+++ b/Essentials/src/com/earth2me/essentials/Essentials.java
@@ -437,11 +437,13 @@ public class Essentials extends JavaPlugin implements IEssentials
{
return (User)base;
}
- User user = userMap.getUser(base.getName()).update(base);
+ User user = userMap.getUser(base.getName());
if (user == null)
{
user = new User(base, this);
+ } else {
+ user.update(base);
}
return user;
}