Fix NPE when disable

Former-commit-id: a28eb31f7d69043570d4d53099fdd46a9ebada7e [formerly ce06882aa2ef706eb5ac813f868311b0ea792cd8]
Former-commit-id: 91e1ca79f40fb13ed5b4ca85b98928d27d65710f
This commit is contained in:
Ghost_chu committed 2019-07-03 21:24:07 +08:00
1 parent e7e64c7970
commit d586fa4fc4
1 file changed
+6 -4
@@ -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.");
}