From 84f7859ca96ee475afe9544ce7ff9b69aee939e4 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 14 Aug 2012 13:26:02 +0100 Subject: [PATCH] Fix an error with Logging set to 'OFF' triggering a cast exception. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/GMConfiguration.java | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 63fa8b9d7..498537647 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -192,4 +192,5 @@ v 2.0: - Change to our own Yaml parsing for globalgroups instead of using the YAMLConfiguration class in bukkit. - Fix a cases sensitivity bug in world loading. - Stop using the YamlConfiguration in bukkit for our config handling. We can now support periods in world names. - - Fix GlobalGroups not loading permission nodes. \ No newline at end of file + - Fix GlobalGroups not loading permission nodes. + - Fix an error with Logging set to 'OFF' triggering a cast exception. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java index 34b50825a..fcc018d17 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java @@ -25,7 +25,7 @@ public class GMConfiguration { private boolean toggleValidate; private Integer saveInterval; private Integer backupDuration; - private String loggerLevel; + private String loggerLevel = "OFF"; private Map mirrorsMap; @@ -82,7 +82,9 @@ public class GMConfiguration { saveInterval = (Integer) save.get("minutes"); backupDuration = (Integer) save.get("hours"); - loggerLevel = ((Map) getElement("settings", GMconfig).get("logging")).get("level"); + Object level = ((Map) getElement("settings", GMconfig).get("logging")).get("level"); + if (level instanceof String) + level = (String) level; /* * Store our mirrors map for parsing later.