From d554dab8c8e8c9cfb7fbad9dc6f8e81b647b238a Mon Sep 17 00:00:00 2001 From: MattBDev Date: Sat, 10 Dec 2016 14:33:48 -0500 Subject: [PATCH] Fix potential NPE with claiming --- .../java/com/intellectualcrafters/plot/object/PlotArea.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/object/PlotArea.java b/Core/src/main/java/com/intellectualcrafters/plot/object/PlotArea.java index b260949c4..19ce0c29f 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/object/PlotArea.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/object/PlotArea.java @@ -21,6 +21,7 @@ import com.intellectualcrafters.plot.util.block.LocalBlockQueue; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -464,11 +465,14 @@ public abstract class PlotArea { } public Set getPlotsAbs(final UUID uuid) { + if (uuid == null) { + return Collections.emptySet(); + } final HashSet myPlots = new HashSet<>(); foreachPlotAbs(new RunnableVal() { @Override public void run(Plot value) { - if (value.owner.equals(uuid)) { + if (uuid.equals(value.owner)) { myPlots.add(value); } }