Add a security in case config fail to load

This commit is contained in:
Xephi 2015-05-26 12:42:03 +02:00
parent 7f844ec946
commit 5585db221f

View File

@ -31,6 +31,7 @@ import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import com.earth2me.essentials.Essentials;
import com.maxmind.geoip.LookupService;
import com.onarandombox.MultiverseCore.MultiverseCore;
@ -118,8 +119,15 @@ public class AuthMe extends JavaPlugin {
authmeLogger.setParent(this.getLogger());
settings = new Settings(this);
settings.loadConfigOptions();
try {
settings = new Settings(this);
settings.loadConfigOptions();
} catch (Exception e)
{
ConsoleLogger.showError("Can't load config file... Something goes wrong, for prevent security issues, server will shutdown");
this.getServer().shutdown();
return;
}
citizens = new CitizensCommunicator(this);