mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-10-06 19:48:12 +02:00
Fix loading users with only numerals in their names to be seen as
strings.
This commit is contained in:
parent
656f25dc97
commit
51d61e7a91
@ -184,4 +184,5 @@ v 2.0:
|
|||||||
- Prevent null perms getting past the GlobalGroups loader.
|
- Prevent null perms getting past the GlobalGroups loader.
|
||||||
- Fix forgetting sub groups on a manload.
|
- Fix forgetting sub groups on a manload.
|
||||||
- Allow 'manucheckp' to notify when superperms reports false but it is really negated.
|
- Allow 'manucheckp' to notify when superperms reports false but it is really negated.
|
||||||
- Only output a Data update message if something has changed.
|
- 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();
|
Iterator<String> usersItr = allUsersNode.keySet().iterator();
|
||||||
String usersKey;
|
String usersKey;
|
||||||
|
Object node;
|
||||||
Integer userCount = 0;
|
Integer userCount = 0;
|
||||||
|
|
||||||
while (usersItr.hasNext()) {
|
while (usersItr.hasNext()) {
|
||||||
try {
|
try {
|
||||||
userCount++;
|
userCount++;
|
||||||
// Attempt to fetch the next user name.
|
// 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) {
|
} catch (Exception ex) {
|
||||||
throw new IllegalArgumentException("Invalid node type for user entry (" + userCount + ") in file: " + usersFile.getPath(), ex);
|
throw new IllegalArgumentException("Invalid node type for user entry (" + userCount + ") in file: " + usersFile.getPath(), ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> thisUserNode = null;
|
Map<String, Object> thisUserNode = null;
|
||||||
try {
|
try {
|
||||||
thisUserNode = (Map<String, Object>) allUsersNode.get(usersKey);
|
thisUserNode = (Map<String, Object>) allUsersNode.get(node);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw new IllegalArgumentException("Bad format found for user: " + usersKey + " in file: " + usersFile.getPath());
|
throw new IllegalArgumentException("Bad format found for user: " + usersKey + " in file: " + usersFile.getPath());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user