Make sure the player is in a world, and if not, fall back to default

configuration.
This commit is contained in:
Evenprime 2011-12-28 19:28:54 +01:00
parent c3a429ca10
commit 1eefa59640

View File

@ -119,11 +119,17 @@ public class NoCheat extends JavaPlugin {
}
public ConfigurationCacheStore getConfig(Player player) {
return conf.getConfigurationCacheForWorld(player.getWorld().getName());
if(player != null)
return getConfig(player.getWorld());
else
return conf.getConfigurationCacheForWorld(null);
}
public ConfigurationCacheStore getConfig(World world) {
return conf.getConfigurationCacheForWorld(world.getName());
if(world != null)
return conf.getConfigurationCacheForWorld(world.getName());
else
return conf.getConfigurationCacheForWorld(null);
}
public void log(LogLevel level, String message, ConfigurationCacheStore cc) {