diff options
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java index 3b0132617..4a1d6506a 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java @@ -162,22 +162,26 @@ public class WorldDataHolder { } // Search for a LastName match - for (String uid : getUUIDLookup(currentName)) { - - User usr = getUsers().get(uid); + + if (nameToUUIDLookup.containsKey(currentName)) { - if (usr.getLastName().equalsIgnoreCase(currentName) && usr.getUUID().equalsIgnoreCase(usr.getLastName())) { + for (String uid : getUUIDLookup(currentName)) { - // Clone this user so we can set it's uUID - user = usr.clone(uUID, currentName); + User usr = getUsers().get(uid); - // Delete it and replace with the new clone. - this.removeUser(usr.getUUID()); - this.addUser(user); + if (usr.getLastName().equalsIgnoreCase(currentName) && usr.getUUID().equalsIgnoreCase(usr.getLastName())) { + + // Clone this user so we can set it's uUID + user = usr.clone(uUID, currentName); + + // Delete it and replace with the new clone. + this.removeUser(usr.getUUID()); + this.addUser(user); + + return getUsers().get(uUID.toLowerCase()); + } - return getUsers().get(uUID.toLowerCase()); } - } |