mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Fix potential NPE with claiming
This commit is contained in:
parent
9ad45750ee
commit
d554dab8c8
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user