From d4dde8c4a64209d987f009e33462a20a1b2bbe45 Mon Sep 17 00:00:00 2001 From: sk89q Date: Sun, 29 Jun 2014 01:43:30 -0700 Subject: [PATCH] [Bukkit] Handle onDisable() better when onEnable() fails. --- .../com/sk89q/worldedit/bukkit/WorldEditPlugin.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bukkit/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/src/bukkit/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index 9f0beff64..0cdaf470d 100644 --- a/src/bukkit/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/src/bukkit/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -156,10 +156,12 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { */ @Override public void onDisable() { - controller.clearSessions(); - controller.getPlatformManager().unregister(server); - config.unload(); - server.unregisterCommands(); + if (controller != null) { + controller.clearSessions(); + controller.getPlatformManager().unregister(server); + config.unload(); + server.unregisterCommands(); + } this.getServer().getScheduler().cancelTasks(this); }