1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-14 10:34:41 +02:00

Trap errors in fetching the mirrors map.

This commit is contained in:
ElgarL
2012-01-25 22:43:07 +00:00
parent d6d4afc3f5
commit 29ca77791c
3 changed files with 8 additions and 4 deletions

View File

@@ -120,4 +120,5 @@ v 1.9:
- Allow negation to the * permission node when populating superperms. - Allow negation to the * permission node when populating superperms.
- Fix trying to modify an unmodifiable collection breaking superperms. - Fix trying to modify an unmodifiable collection breaking superperms.
- Fixed subgroups (I broke earlier). - Fixed subgroups (I broke earlier).
- Check for a null player object in the PlayerTeleportEvent. - Check for a null player object in the PlayerTeleportEvent.
- Trap errors in fetching the mirrors map.

View File

@@ -66,10 +66,12 @@ public class GMConfiguration {
public Map<String, Object> getMirrorsMap() { public Map<String, Object> getMirrorsMap() {
// Try to fetch the old mirror path first // Try to fetch the old mirror path first
if (GMconfig.isConfigurationSection("settings.permission.world.mirror")) if (GMconfig.isConfigurationSection("settings.permission.world.mirror")) {
return (Map<String, Object>) GMconfig.getConfigurationSection("settings.permission.world.mirror").getValues(false); return (Map<String, Object>) GMconfig.getConfigurationSection("settings.permission.world.mirror").getValues(false);
else } else if (GMconfig.isConfigurationSection("settings.mirrors")){
return (Map<String, Object>) GMconfig.getConfigurationSection("settings.mirrors").getValues(false); return (Map<String, Object>) GMconfig.getConfigurationSection("settings.mirrors").getValues(false);
}
return null;
} }

View File

@@ -116,7 +116,8 @@ public class WorldsHolder {
public void mirrorSetUp() { public void mirrorSetUp() {
mirrorsGroup.clear(); mirrorsGroup.clear();
mirrorsUser.clear(); mirrorsUser.clear();
Map<String, Object> mirrorsMap = plugin.getGMConfig().getMirrorsMap(); Map<String, Object> mirrorsMap = plugin.getGMConfig().getMirrorsMap();
if (mirrorsMap != null) { if (mirrorsMap != null) {
for (String source : mirrorsMap.keySet()) { for (String source : mirrorsMap.keySet()) {
// Make sure all non mirrored worlds have a set of data files. // Make sure all non mirrored worlds have a set of data files.