- Fix NPE in JsonCache.

This commit is contained in:
DNx5 2016-06-29 06:06:54 +07:00
parent 392b8ac19e
commit b455e20811
2 changed files with 8 additions and 2 deletions

View File

@ -39,7 +39,12 @@ public class JsonCache {
private BukkitService bukkitService;
@Inject
public JsonCache(@DataFolder File dataFolder) {
public JsonCache(@DataFolder File dataFolder, PermissionsManager permsMan,
SpawnLoader spawnLoader, BukkitService bukkitService) {
this.permissionsManager = permsMan;
this.spawnLoader = spawnLoader;
this.bukkitService = bukkitService;
cacheDir = new File(dataFolder, "cache");
if (!cacheDir.exists() && !cacheDir.isDirectory() && !cacheDir.mkdir()) {
ConsoleLogger.showError("Failed to create cache directory.");

View File

@ -28,9 +28,10 @@ public class LimboCache {
private SpawnLoader spawnLoader;
@Inject
LimboCache(PermissionsManager permissionsManager, SpawnLoader spawnLoader) {
LimboCache(PermissionsManager permissionsManager, SpawnLoader spawnLoader, JsonCache jsonCache) {
this.permissionsManager = permissionsManager;
this.spawnLoader = spawnLoader;
this.jsonCache = jsonCache;
}
/**