mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
Fix #1208 NPE
This commit is contained in:
parent
7dc7714261
commit
30d49880b6
@ -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<String, HashMap<PlotId, Plot>> getPlotMePlots(Connection connection) throws SQLException;
|
||||
|
||||
|
@ -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")) {
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user