Error and Crash while creating the Configuration file
e7p opened this issue ยท 1 comments
While starting Bukkit with the current version of this plugin, it causes Bukkit to crash with the following error:
18:19:51 [INFO] [DataLog] Starting DataLog initiation process... 18:19:51 [INFO] [DataLog] No config.yml detected, creating default file. Please make sure bukkit.yml is configured with your MySQL details 18:19:51 [INFO] [DataLog] Updating config file to v1.1 18:19:51 [INFO] [DataLog] IMPORTANT: After server has rebooted, stop server and configure plugins/DataLog/config.yml with new info 18:19:51 [SCHWERWIEGEND] Error occurred while enabling DataLog v1.2.0 (Is it up to date?): null java.lang.NullPointerException at uk.co.oliwali.DataLog.util.Config.<init>(Config.java:81) at uk.co.oliwali.DataLog.DataLog.onEnable(DataLog.java:62) at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126) at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader .java:857) at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage r.java:264) at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:151) at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:136 ) at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:284) at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:271) at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:148) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335) at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
It is caused by a missing definition of the String List keys and can be fixed using this patch:
--- src/uk/co/oliwali/DataLog/util/Config.java 2011-06-30 19:29:10.000000000 +0200
+++ src/uk/co/oliwali/DataLog/util/Config.java 2011-07-02 18:39:46.739649600 +0200
@@ -78,6 +78,9 @@
config.setProperty("block-filter", Arrays.asList(new Integer[]{33,34}));
//Check general settings
keys = config.getKeys("general");
- if (keys == null)
- keys = new ArrayList<String>();
+
if (!keys.contains("max-lines"))
config.setProperty("general.max-lines", 0);
if (!keys.contains("max-radius"))