mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-18 08:35:53 +01:00
Fix NPE when a manager fails to load.
This commit is contained in:
parent
51f98c9eb7
commit
a2fc9c94fd
@ -19,19 +19,6 @@
|
||||
|
||||
package com.sk89q.worldguard.protection;
|
||||
|
||||
import static com.sk89q.worldguard.bukkit.BukkitUtil.toVector;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.sk89q.worldguard.LocalPlayer;
|
||||
import com.sk89q.worldguard.bukkit.BukkitUtil;
|
||||
import com.sk89q.worldguard.bukkit.ConfigurationManager;
|
||||
@ -44,6 +31,18 @@
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag;
|
||||
import com.sk89q.worldguard.protection.managers.PRTreeRegionManager;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import static com.sk89q.worldguard.bukkit.BukkitUtil.toVector;
|
||||
|
||||
/**
|
||||
* This class keeps track of region information for every world. It loads
|
||||
@ -129,7 +128,9 @@ public void unloadAll() {
|
||||
|
||||
public RegionManager load(World world) {
|
||||
RegionManager manager = create(world);
|
||||
managers.put(world.getName(), manager);
|
||||
if (manager != null) {
|
||||
managers.put(world.getName(), manager);
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user