Fix kickAllPlayers() NPE

This commit is contained in:
Daniel Saukel 2020-06-24 00:31:51 +02:00
parent fbb08ac232
commit 74f3829282
1 changed files with 3 additions and 1 deletions

View File

@ -170,7 +170,9 @@ public abstract class DInstanceWorld implements InstanceWorld {
public void kickAllPlayers() {
getPlayers().forEach(p -> p.leave());
// Players who shouldn't be in the dungeon but still are for some reason
getWorld().getPlayers().forEach(p -> PlayerUtil.secureTeleport(p, Bukkit.getWorlds().get(0).getSpawnLocation()));
if (world != null) {
getWorld().getPlayers().forEach(p -> PlayerUtil.secureTeleport(p, Bukkit.getWorlds().get(0).getSpawnLocation()));
}
}
/**