mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-24 11:38:40 +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
|
@Override
|
||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
// init logger asap
|
|
||||||
this.logger = new JavaPluginLogger(getLogger());
|
this.logger = new JavaPluginLogger(getLogger());
|
||||||
|
|
||||||
// call load
|
|
||||||
try {
|
try {
|
||||||
this.plugin.load();
|
this.plugin.load();
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -49,7 +49,7 @@ public class LPNukkitBootstrap extends PluginBase implements LuckPermsBootstrap
|
|||||||
/**
|
/**
|
||||||
* The plugin logger
|
* The plugin logger
|
||||||
*/
|
*/
|
||||||
private final PluginLogger logger;
|
private PluginLogger logger = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A scheduler adapter for the platform
|
* A scheduler adapter for the platform
|
||||||
@ -76,7 +76,6 @@ public class LPNukkitBootstrap extends PluginBase implements LuckPermsBootstrap
|
|||||||
private final CountDownLatch enableLatch = new CountDownLatch(1);
|
private final CountDownLatch enableLatch = new CountDownLatch(1);
|
||||||
|
|
||||||
public LPNukkitBootstrap() {
|
public LPNukkitBootstrap() {
|
||||||
this.logger = new NukkitPluginLogger(getLogger());
|
|
||||||
this.schedulerAdapter = new NukkitSchedulerAdapter(this);
|
this.schedulerAdapter = new NukkitSchedulerAdapter(this);
|
||||||
this.classLoader = new ReflectionClassLoader(this);
|
this.classLoader = new ReflectionClassLoader(this);
|
||||||
this.plugin = new LPNukkitPlugin(this);
|
this.plugin = new LPNukkitPlugin(this);
|
||||||
@ -86,6 +85,9 @@ public class LPNukkitBootstrap extends PluginBase implements LuckPermsBootstrap
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PluginLogger getPluginLogger() {
|
public PluginLogger getPluginLogger() {
|
||||||
|
if (this.logger == null) {
|
||||||
|
throw new IllegalStateException("Logger has not been initialised yet");
|
||||||
|
}
|
||||||
return this.logger;
|
return this.logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,6 +105,8 @@ public class LPNukkitBootstrap extends PluginBase implements LuckPermsBootstrap
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
|
this.logger = new NukkitPluginLogger(getLogger());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.plugin.load();
|
this.plugin.load();
|
||||||
} finally {
|
} finally {
|
||||||
|
Loading…
Reference in New Issue
Block a user