mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-24 03:25:19 +01:00
Fix NPE on Nukkit load (#1059)
This commit is contained in:
parent
5b66436519
commit
6f96d9c7d1
@ -108,10 +108,8 @@ public class LPBungeeBootstrap extends Plugin implements LuckPermsBootstrap {
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
// init logger asap
|
||||
this.logger = new JavaPluginLogger(getLogger());
|
||||
|
||||
// call load
|
||||
try {
|
||||
this.plugin.load();
|
||||
} finally {
|
||||
|
@ -49,7 +49,7 @@ public class LPNukkitBootstrap extends PluginBase implements LuckPermsBootstrap
|
||||
/**
|
||||
* The plugin logger
|
||||
*/
|
||||
private final PluginLogger logger;
|
||||
private PluginLogger logger = null;
|
||||
|
||||
/**
|
||||
* A scheduler adapter for the platform
|
||||
@ -76,7 +76,6 @@ public class LPNukkitBootstrap extends PluginBase implements LuckPermsBootstrap
|
||||
private final CountDownLatch enableLatch = new CountDownLatch(1);
|
||||
|
||||
public LPNukkitBootstrap() {
|
||||
this.logger = new NukkitPluginLogger(getLogger());
|
||||
this.schedulerAdapter = new NukkitSchedulerAdapter(this);
|
||||
this.classLoader = new ReflectionClassLoader(this);
|
||||
this.plugin = new LPNukkitPlugin(this);
|
||||
@ -86,6 +85,9 @@ public class LPNukkitBootstrap extends PluginBase implements LuckPermsBootstrap
|
||||
|
||||
@Override
|
||||
public PluginLogger getPluginLogger() {
|
||||
if (this.logger == null) {
|
||||
throw new IllegalStateException("Logger has not been initialised yet");
|
||||
}
|
||||
return this.logger;
|
||||
}
|
||||
|
||||
@ -103,6 +105,8 @@ public class LPNukkitBootstrap extends PluginBase implements LuckPermsBootstrap
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.logger = new NukkitPluginLogger(getLogger());
|
||||
|
||||
try {
|
||||
this.plugin.load();
|
||||
} finally {
|
||||
|
Loading…
Reference in New Issue
Block a user