Fix potential NPE with claiming

This commit is contained in:
MattBDev 2016-12-10 14:33:48 -05:00
parent 9ad45750ee
commit d554dab8c8

View file

@ -21,6 +21,7 @@ import com.intellectualcrafters.plot.util.block.LocalBlockQueue;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
@ -464,11 +465,14 @@ public abstract class PlotArea {
} }
public Set<Plot> getPlotsAbs(final UUID uuid) { public Set<Plot> getPlotsAbs(final UUID uuid) {
if (uuid == null) {
return Collections.emptySet();
}
final HashSet<Plot> myPlots = new HashSet<>(); final HashSet<Plot> myPlots = new HashSet<>();
foreachPlotAbs(new RunnableVal<Plot>() { foreachPlotAbs(new RunnableVal<Plot>() {
@Override @Override
public void run(Plot value) { public void run(Plot value) {
if (value.owner.equals(uuid)) { if (uuid.equals(value.owner)) {
myPlots.add(value); myPlots.add(value);
} }
} }