diff --git a/Core/src/main/java/com/plotsquared/core/database/SQLManager.java b/Core/src/main/java/com/plotsquared/core/database/SQLManager.java index 3c530b3186..63d1af450c 100644 --- a/Core/src/main/java/com/plotsquared/core/database/SQLManager.java +++ b/Core/src/main/java/com/plotsquared/core/database/SQLManager.java @@ -2401,7 +2401,8 @@ public void setPosition(final Plot plot, final String position) { addPlotTask(plot, new UniqueStatement("setPosition") { @Override public void set(PreparedStatement statement) throws SQLException { - statement.setString(1, position == null ? "" : position); + // Please see the table creation statement. There is the default value of "default" + statement.setString(1, position == null ? "DEFAULT" : position); statement.setInt(2, getId(plot)); } diff --git a/Core/src/main/java/com/plotsquared/core/plot/Plot.java b/Core/src/main/java/com/plotsquared/core/plot/Plot.java index 2c47ef322c..67db8a698e 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java +++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java @@ -1483,7 +1483,7 @@ private Location toHomeLocation(Location bottom, BlockLoc relativeHome) { */ public void setHome(BlockLoc location) { Plot plot = this.getBasePlot(false); - if (BlockLoc.ZERO.equals(location) || BlockLoc.MINY.equals(location)) { + if (location != null && (BlockLoc.ZERO.equals(location) || BlockLoc.MINY.equals(location))) { return; } plot.getSettings().setPosition(location);