summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'EssentialsGroupManager/src/org')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java5
-rw-r--r--[-rwxr-xr-x]EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java4
2 files changed, 7 insertions, 2 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
index ae68e03cc..77d933fa0 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
@@ -578,6 +578,11 @@ public class WorldDataHolder {
// PROCESS USERS FILE
Map<String, Object> allUsersNode = (Map<String, Object>) usersRootDataNode.get("users");
+
+ // Stop loading if the file is empty
+ if (allUsersNode == null)
+ return ph;
+
for (String usersKey : allUsersNode.keySet()) {
Map<String, Object> thisUserNode = (Map<String, Object>) allUsersNode.get(usersKey);
User thisUser = ph.createUser(usersKey);
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
index b4d50b431..a2c34be16 100755..100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
@@ -265,7 +265,7 @@ public class WorldsHolder {
File groupsFile = new File(defaultWorldFolder, "groups.yml");
File usersFile = new File(defaultWorldFolder, "users.yml");
File oldDataFile = new File(plugin.getDataFolder(), "data.yml");
- if (!groupsFile.exists()) {
+ if (!groupsFile.exists() || groupsFile.length() == 0) {
if (oldDataFile.exists()) {
try {
Tasks.copy(oldDataFile, groupsFile);
@@ -281,7 +281,7 @@ public class WorldsHolder {
}
}
}
- if (!usersFile.exists()) {
+ if (!usersFile.exists() || usersFile.length() == 0) {
if (oldDataFile.exists()) {
try {
Tasks.copy(oldDataFile, usersFile);