From 1917a08d143d58692dec863c3f4e3371aa8d66ad Mon Sep 17 00:00:00 2001 From: Pepich Date: Wed, 1 Feb 2017 17:41:38 +0100 Subject: [PATCH] Made module auto-gen empty files if they don't exist yet --- src/com/redstoner/modules/chatgroups/Chatgroups.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/com/redstoner/modules/chatgroups/Chatgroups.java b/src/com/redstoner/modules/chatgroups/Chatgroups.java index 1630f27..a5cda2f 100644 --- a/src/com/redstoner/modules/chatgroups/Chatgroups.java +++ b/src/com/redstoner/modules/chatgroups/Chatgroups.java @@ -24,7 +24,7 @@ import com.redstoner.modules.Module; * * @author Pepich */ @AutoRegisterListener -@Version(major = 1, minor = 1, revision = 0, compatible = 1) +@Version(major = 1, minor = 1, revision = 1, compatible = 1) public class Chatgroups implements Module, Listener { private static final char defaultKey = ':'; @@ -39,12 +39,15 @@ public class Chatgroups implements Module, Listener { groups = JsonManager.getObject(groupsLocation); if (groups == null) - return; + { + groups = new JSONObject(); + saveGroups(); + } keys = JsonManager.getObject(keysLocation); if (keys == null) { - groups = null; - return; + keys = new JSONObject(); + saveKeys(); } cgtoggled = new ArrayList(); enabled = true;