[Bukkit] Handle onDisable() better when onEnable() fails.

This commit is contained in:
sk89q 2014-06-29 01:43:30 -07:00
parent 302d089d55
commit d4dde8c4a6

View File

@ -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);
}