mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
Fix potential NPE with claiming
This commit is contained in:
parent
9ad45750ee
commit
d554dab8c8
1 changed files with 5 additions and 1 deletions
|
@ -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 a new issue