From 3740f200f8dc99c05e42201d8b23ffc279cbd6a6 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Fri, 15 Feb 2013 17:39:34 +0000 Subject: [PATCH] Catch the error when using an out of date config for 'allow_commandblocks' So it doesn't kill the whole config. --- EssentialsGroupManager/src/Changelog.txt | 1 + .../src/org/anjocaido/groupmanager/GMConfiguration.java | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index f3bc35baa..be9ec8abd 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -213,3 +213,4 @@ v 2.0: - Prevent '*' permissions granting the 'groupmanager.noofflineperms' permission. - Added '/mancheckw ' to inspect which permission files a world is referencing. - Add config potion to set if GM commands should be allowed on CommnandBlocks. + - Catch the error when using an out of date config for 'allow_commandblocks' So it doesn't kill the whole config. \ 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 e5a24258e..2f68b6d7d 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java @@ -85,7 +85,13 @@ public class GMConfiguration { try { Map config = getElement("config", getElement("settings", GMconfig)); - allowCommandBlocks = (Boolean) config.get("allow_commandblocks"); + try { + allowCommandBlocks = (Boolean) config.get("allow_commandblocks"); + + } catch (Exception ex) { + GroupManager.logger.log(Level.SEVERE, "Missing or corrupt 'allow_commandblocks' node. Using default settings", ex); + } + opOverride = (Boolean) config.get("opOverrides"); toggleValidate = (Boolean) config.get("validate_toggle");