mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 09:37:50 +01:00
Fix loading users with only numerals in their names to be seen as
strings.
This commit is contained in:
parent
656f25dc97
commit
51d61e7a91
@ -185,3 +185,4 @@ v 2.0:
|
||||
- Fix forgetting sub groups on a manload.
|
||||
- Allow 'manucheckp' to notify when superperms reports false but it is really negated.
|
||||
- Only output a Data update message if something has changed.
|
||||
- Fix loading users with only numerals in their names to be seen as strings.
|
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user