mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-10-31 17:43:44 +01:00 
			
		
		
		
	Fix #1208 NPE
This commit is contained in:
		| @@ -13,7 +13,7 @@ import java.util.HashMap; | |||||||
|  |  | ||||||
| public abstract class APlotMeConnector { | 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; |     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 { | public class ClassicPlotMeConnector extends APlotMeConnector { | ||||||
|  |  | ||||||
|     private String plugin; |     private String plugin = "PlotMe"; | ||||||
|     private String prefix; |     private String prefix; | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public Connection getPlotMeConnection(FileConfiguration plotConfig, String dataFolder) { |     public Connection getPlotMeConnection(String plugin, FileConfiguration plotConfig, String dataFolder) { | ||||||
|         this.plugin = this.plugin.toLowerCase(); |         this.plugin = plugin.toLowerCase(); | ||||||
|         this.prefix = plotConfig.getString("mySQLprefix", this.plugin.toLowerCase()); |         this.prefix = plotConfig.getString("mySQLprefix", this.plugin.toLowerCase()); | ||||||
|         try { |         try { | ||||||
|             if (plotConfig.getBoolean("usemySQL")) { |             if (plotConfig.getBoolean("usemySQL")) { | ||||||
|   | |||||||
| @@ -123,7 +123,7 @@ public class LikePlotMeConverter { | |||||||
|  |  | ||||||
|             PS.debug("&3Using connector: " + connector.getClass().getCanonicalName()); |             PS.debug("&3Using connector: " + connector.getClass().getCanonicalName()); | ||||||
|  |  | ||||||
|             Connection connection = connector.getPlotMeConnection(plotConfig, dataFolder); |             Connection connection = connector.getPlotMeConnection(plugin,plotConfig, dataFolder); | ||||||
|  |  | ||||||
|             if (!connector.isValidConnection(connection)) { |             if (!connector.isValidConnection(connection)) { | ||||||
|                 sendMessage("Cannot connect to PlotMe DB. Conversion process will not continue"); |                 sendMessage("Cannot connect to PlotMe DB. Conversion process will not continue"); | ||||||
|   | |||||||
| @@ -26,8 +26,8 @@ public class PlotMeConnector_017 extends APlotMeConnector { | |||||||
|     private String plugin; |     private String plugin; | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public Connection getPlotMeConnection(FileConfiguration plotConfig, String dataFolder) { |     public Connection getPlotMeConnection(String plugin, FileConfiguration plotConfig, String dataFolder) { | ||||||
|         this.plugin = this.plugin.toLowerCase(); |         this.plugin = plugin.toLowerCase(); | ||||||
|         try { |         try { | ||||||
|             if (plotConfig.getBoolean("usemySQL")) { |             if (plotConfig.getBoolean("usemySQL")) { | ||||||
|                 String user = plotConfig.getString("mySQLuname"); |                 String user = plotConfig.getString("mySQLuname"); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 MattBDev
					MattBDev