From 46f05ee92f1deabe18dde1f527494fb717a079bd Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 21 Feb 2012 22:14:11 +0000 Subject: [PATCH] Check to see if home section exists. --- Essentials/src/com/earth2me/essentials/UserData.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 643c45868..e540bd998 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -2,7 +2,6 @@ package com.earth2me.essentials; import java.io.File; import java.util.*; -import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Location; import org.bukkit.Material; @@ -95,7 +94,10 @@ public abstract class UserData extends PlayerExtension implements IConf private Map _getHomes() { - return config.getConfigurationSection("homes").getValues(false); + if (config.isConfigurationSection("homes")) { + return config.getConfigurationSection("homes").getValues(false); + } + return new HashMap(); } public Location getHome(String name) throws Exception @@ -145,7 +147,6 @@ public abstract class UserData extends PlayerExtension implements IConf public List getHomes() { - ess.getLogger().log(Level.INFO, "player " + this.getName() + " homecount: " + homes.size()); return new ArrayList(homes.keySet()); }