From d586fa4fc42062c7fafd4dadd64a9db841807c75 Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Wed, 3 Jul 2019 21:12:33 +0800 Subject: [PATCH] Fix NPE when disable Former-commit-id: a28eb31f7d69043570d4d53099fdd46a9ebada7e [formerly ce06882aa2ef706eb5ac813f868311b0ea792cd8] Former-commit-id: 91e1ca79f40fb13ed5b4ca85b98928d27d65710f --- src/main/java/org/maxgamer/quickshop/QuickShop.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index e66c35063..17308135b 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -843,9 +843,11 @@ public class QuickShop extends JavaPlugin { UpdateWatcher.uninit(); Util.debugLog("Cleaning up resources and unloading all shops..."); /* Remove all display items, and any dupes we can find */ - shopManager.clear(); + if (shopManager != null) + shopManager.clear(); /* Empty the buffer */ - database.close(); + if (databaseManager != null) + database.close(); /* Close Database */ try { this.database.getConnection().close(); @@ -853,8 +855,8 @@ public class QuickShop extends JavaPlugin { this.getSentryErrorReporter().ignoreThrow(); e.printStackTrace(); } - - this.warnings.clear(); + if (warnings != null) + warnings.clear(); //this.reloadConfig(); Util.debugLog("All shutdown work is finished."); }