From f93bddcc1bb094e638a22011a524f224d9c66d9d Mon Sep 17 00:00:00 2001 From: Govindas <16716020+GovindasOM@users.noreply.github.com> Date: Sat, 12 Jun 2021 14:47:13 +0300 Subject: [PATCH] do not start new Thread too early --- .../automaticlogdeleter/AutomaticLogDeleter.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/limework/automaticlogdeleter/AutomaticLogDeleter.java b/src/main/java/net/limework/automaticlogdeleter/AutomaticLogDeleter.java index e2547db..f7c19c8 100644 --- a/src/main/java/net/limework/automaticlogdeleter/AutomaticLogDeleter.java +++ b/src/main/java/net/limework/automaticlogdeleter/AutomaticLogDeleter.java @@ -20,12 +20,12 @@ public final class AutomaticLogDeleter extends JavaPlugin { @Override public void onDisable() { - new Thread(() -> { - FileConfiguration config = getConfig(); - if (config.getBoolean("also-delete-logs-on-shutdown")) { + FileConfiguration config = getConfig(); + if (config.getBoolean("also-delete-logs-on-shutdown")) { + new Thread(() -> { deleteLogs(); - } - }).start(); + }).start(); + } } public void deleteLogs() {