mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-24 19:45:43 +01:00
Fix NPE on interact while creating portal
This commit is contained in:
parent
bcd931c2fe
commit
4f43db7390
@ -24,6 +24,7 @@ import io.github.dre2n.dungeonsxl.game.Game;
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.player.DPlayer;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -210,7 +211,11 @@ public class DPortal extends GlobalProtection {
|
||||
@Override
|
||||
public Set<Block> getBlocks() {
|
||||
if (blocks == null) {
|
||||
blocks = BlockUtil.getBlocksBetween(block1, block2);
|
||||
if (block1 != null && block2 != null) {
|
||||
blocks = BlockUtil.getBlocksBetween(block1, block2);
|
||||
} else {
|
||||
blocks = new HashSet<>();
|
||||
}
|
||||
}
|
||||
|
||||
return blocks;
|
||||
|
Loading…
Reference in New Issue
Block a user