3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-26 02:50:06 +01:00

Fix NPE on AbstractRegion#equals

Dieser Commit ist enthalten in:
Hannes Greule 2020-08-06 23:53:24 +02:00
Ursprung 3b7f7237b8
Commit dcdb42eadb

Datei anzeigen

@ -32,6 +32,7 @@ import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.Set; import java.util.Set;
public abstract class AbstractRegion extends AbstractSet<BlockVector3> implements Region { public abstract class AbstractRegion extends AbstractSet<BlockVector3> implements Region {
@ -226,12 +227,8 @@ public abstract class AbstractRegion extends AbstractSet<BlockVector3> implement
return false; return false;
} }
Region region = ((Region) o); Region region = ((Region) o);
if (this.getWorld() != region.getWorld()) {
if (this.getWorld() == null || region.getWorld() == null) { if (Objects.equals(this.getWorld(), region.getWorld())
return false;
}
}
if (this.getWorld().equals(region.getWorld())
&& this.getMinimumPoint().equals(region.getMinimumPoint()) && this.getMinimumPoint().equals(region.getMinimumPoint())
&& this.getMaximumPoint().equals(region.getMaximumPoint()) && this.getMaximumPoint().equals(region.getMaximumPoint())
&& this.getVolume() == region.getVolume()) { && this.getVolume() == region.getVolume()) {