Fix #627 - skip Floodgate config validation if there's no Floodgate installed

Fix BungeeManager NPE
This commit is contained in:
Krakenied
2021-10-09 19:51:46 +02:00
parent 28480a0f01
commit d7e0a4469f

View File

@ -148,12 +148,10 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
private boolean initializeFloodgate() { private boolean initializeFloodgate() {
if (getServer().getPluginManager().getPlugin("Floodgate") != null) { if (getServer().getPluginManager().getPlugin("Floodgate") != null) {
floodgateService = new FloodgateService(FloodgateApi.getInstance(), core); floodgateService = new FloodgateService(FloodgateApi.getInstance(), core);
}
// Check Floodgate config values // Check Floodgate config values and return
if (!floodgateService.isValidFloodgateConfigString("autoLoginFloodgate") return floodgateService.isValidFloodgateConfigString("autoLoginFloodgate")
|| !floodgateService.isValidFloodgateConfigString("allowFloodgateNameConflict")) { && floodgateService.isValidFloodgateConfigString("allowFloodgateNameConflict");
return false;
} }
return true; return true;
@ -168,7 +166,10 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
core.close(); core.close();
} }
bungeeManager.cleanup(); if (bungeeManager != null) {
bungeeManager.cleanup();
}
if (premiumPlaceholder != null && getServer().getPluginManager().isPluginEnabled("PlaceholderAPI")) { if (premiumPlaceholder != null && getServer().getPluginManager().isPluginEnabled("PlaceholderAPI")) {
try { try {
premiumPlaceholder.unregister(); premiumPlaceholder.unregister();