mirror of
https://github.com/Flowsqy/ShopChest.git
synced 2025-03-01 16:01:03 +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() {
|
public void onLoad() {
|
||||||
instance = this;
|
instance = this;
|
||||||
|
|
||||||
|
// Set a default debugger
|
||||||
|
this.debugLogger = new NullDebugLogger(getLogger());
|
||||||
|
|
||||||
configManager = new ConfigManager(this, getDataFolder());
|
configManager = new ConfigManager(this, getDataFolder());
|
||||||
|
|
||||||
if (!configManager.checkDataFolder()) {
|
if (!configManager.checkDataFolder()) {
|
||||||
@ -159,7 +162,6 @@ public class ShopChest extends JavaPlugin {
|
|||||||
*/
|
*/
|
||||||
private void cancelLoading(String reason) {
|
private void cancelLoading(String reason) {
|
||||||
final String disableMessage = "Disabling the plugin";
|
final String disableMessage = "Disabling the plugin";
|
||||||
final DebugLogger debugLogger = this.debugLogger != null ? this.debugLogger : new NullDebugLogger(getLogger());
|
|
||||||
debugLogger.debug(reason);
|
debugLogger.debug(reason);
|
||||||
debugLogger.debug(disableMessage);
|
debugLogger.debug(disableMessage);
|
||||||
debugLogger.getLogger().warning(reason);
|
debugLogger.getLogger().warning(reason);
|
||||||
|
Loading…
Reference in New Issue
Block a user