diff options
author | ElgarL <ElgarL@palmergames.com> | 2012-06-24 13:10:22 +0100 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2012-06-24 13:10:22 +0100 |
commit | 51d61e7a915aa86d4291516dede211ec454c630f (patch) | |
tree | d72d77f5b263285b349cb50b1219ff93f69d5a06 /EssentialsGroupManager/src/org | |
parent | 656f25dc97f6b094b86131263d17a6d8069370f7 (diff) | |
download | Essentials-51d61e7a915aa86d4291516dede211ec454c630f.tar Essentials-51d61e7a915aa86d4291516dede211ec454c630f.tar.gz Essentials-51d61e7a915aa86d4291516dede211ec454c630f.tar.lz Essentials-51d61e7a915aa86d4291516dede211ec454c630f.tar.xz Essentials-51d61e7a915aa86d4291516dede211ec454c630f.zip |
Fix loading users with only numerals in their names to be seen as
strings.
Diffstat (limited to 'EssentialsGroupManager/src/org')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java index fefc698f9..1ccd48772 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java @@ -775,20 +775,26 @@ public class WorldDataHolder { Iterator<String> usersItr = allUsersNode.keySet().iterator(); String usersKey; + Object node; Integer userCount = 0; while (usersItr.hasNext()) { try { userCount++; // Attempt to fetch the next user name. - usersKey = usersItr.next(); + node = usersItr.next(); + if (node instanceof Integer) + usersKey = Integer.toString((Integer)node); + else + usersKey = node.toString(); + } catch (Exception ex) { throw new IllegalArgumentException("Invalid node type for user entry (" + userCount + ") in file: " + usersFile.getPath(), ex); } Map<String, Object> thisUserNode = null; try { - thisUserNode = (Map<String, Object>) allUsersNode.get(usersKey); + thisUserNode = (Map<String, Object>) allUsersNode.get(node); } catch (Exception ex) { throw new IllegalArgumentException("Bad format found for user: " + usersKey + " in file: " + usersFile.getPath()); } |