mirror of
https://github.com/Flowsqy/ShopChest.git
synced 2024-12-01 01:53:22 +01:00
Set a default debugger during the load phase to avoid null errors
This commit is contained in:
parent
c8035de739
commit
ef1479dfdc
@ -68,6 +68,9 @@ public class ShopChest extends JavaPlugin {
|
||||
public void onLoad() {
|
||||
instance = this;
|
||||
|
||||
// Set a default debugger
|
||||
this.debugLogger = new NullDebugLogger(getLogger());
|
||||
|
||||
configManager = new ConfigManager(this, getDataFolder());
|
||||
|
||||
if (!configManager.checkDataFolder()) {
|
||||
@ -159,7 +162,6 @@ public class ShopChest extends JavaPlugin {
|
||||
*/
|
||||
private void cancelLoading(String reason) {
|
||||
final String disableMessage = "Disabling the plugin";
|
||||
final DebugLogger debugLogger = this.debugLogger != null ? this.debugLogger : new NullDebugLogger(getLogger());
|
||||
debugLogger.debug(reason);
|
||||
debugLogger.debug(disableMessage);
|
||||
debugLogger.getLogger().warning(reason);
|
||||
|
Loading…
Reference in New Issue
Block a user