From 96eb4af5578fd73aae4fa12a850dac819357dca5 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Mon, 23 Mar 2015 01:43:19 +1100 Subject: [PATCH] Recover from invalid merge --- .../intellectualcrafters/plot/util/MainUtil.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java index 0b0af1eca..6251225db 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java @@ -1095,12 +1095,21 @@ public class MainUtil { public static Plot getTopPlot(final Plot plot) { if (plot.settings.getMerged(2)) { - return getTopPlot(PlotSquared.getPlots(plot.world).get(new PlotId(plot.id.x, plot.id.y + 1))); + final Plot p = PlotSquared.getPlots(plot.world).get(new PlotId(plot.id.x, plot.id.y + 1)); + if (p == null) { + return plot; + } + return getTopPlot(p); } if (plot.settings.getMerged(1)) { - return getTopPlot(PlotSquared.getPlots(plot.world).get(new PlotId(plot.id.x + 1, plot.id.y))); + final Plot p = PlotSquared.getPlots(plot.world).get(new PlotId(plot.id.x + 1, plot.id.y)); + if (p == null) { + return plot; + } + return getTopPlot(p); } return plot; + } public static PlotId getSize(final String world, final Plot plot) {