From 30d49880b656258b8980c85c32e52c50c48acba7 Mon Sep 17 00:00:00 2001 From: MattBDev Date: Wed, 22 Jun 2016 16:31:04 -0400 Subject: [PATCH] Fix #1208 NPE --- .../bukkit/database/plotme/APlotMeConnector.java | 2 +- .../bukkit/database/plotme/ClassicPlotMeConnector.java | 6 +++--- .../bukkit/database/plotme/LikePlotMeConverter.java | 2 +- .../bukkit/database/plotme/PlotMeConnector_017.java | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/APlotMeConnector.java b/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/APlotMeConnector.java index f7d26c746..1ebae3a93 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/APlotMeConnector.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/APlotMeConnector.java @@ -13,7 +13,7 @@ import java.util.HashMap; public abstract class APlotMeConnector { - public abstract Connection getPlotMeConnection(FileConfiguration plotConfig, String dataFolder); + public abstract Connection getPlotMeConnection(String plugin, FileConfiguration plotConfig, String dataFolder); public abstract HashMap> getPlotMePlots(Connection connection) throws SQLException; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/ClassicPlotMeConnector.java b/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/ClassicPlotMeConnector.java index 92db4f3cf..11cea6ddb 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/ClassicPlotMeConnector.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/ClassicPlotMeConnector.java @@ -26,12 +26,12 @@ import java.util.UUID; public class ClassicPlotMeConnector extends APlotMeConnector { - private String plugin; + private String plugin = "PlotMe"; private String prefix; @Override - public Connection getPlotMeConnection(FileConfiguration plotConfig, String dataFolder) { - this.plugin = this.plugin.toLowerCase(); + public Connection getPlotMeConnection(String plugin, FileConfiguration plotConfig, String dataFolder) { + this.plugin = plugin.toLowerCase(); this.prefix = plotConfig.getString("mySQLprefix", this.plugin.toLowerCase()); try { if (plotConfig.getBoolean("usemySQL")) { diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/LikePlotMeConverter.java b/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/LikePlotMeConverter.java index 672b0644b..88e8a5c46 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/LikePlotMeConverter.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/LikePlotMeConverter.java @@ -123,7 +123,7 @@ public class LikePlotMeConverter { PS.debug("&3Using connector: " + connector.getClass().getCanonicalName()); - Connection connection = connector.getPlotMeConnection(plotConfig, dataFolder); + Connection connection = connector.getPlotMeConnection(plugin,plotConfig, dataFolder); if (!connector.isValidConnection(connection)) { sendMessage("Cannot connect to PlotMe DB. Conversion process will not continue"); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/PlotMeConnector_017.java b/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/PlotMeConnector_017.java index 124e55594..429248e6b 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/PlotMeConnector_017.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/database/plotme/PlotMeConnector_017.java @@ -26,8 +26,8 @@ public class PlotMeConnector_017 extends APlotMeConnector { private String plugin; @Override - public Connection getPlotMeConnection(FileConfiguration plotConfig, String dataFolder) { - this.plugin = this.plugin.toLowerCase(); + public Connection getPlotMeConnection(String plugin, FileConfiguration plotConfig, String dataFolder) { + this.plugin = plugin.toLowerCase(); try { if (plotConfig.getBoolean("usemySQL")) { String user = plotConfig.getString("mySQLuname");