From 5dfd9ad31042fd21aeee1445a69375b1c3dbc1eb Mon Sep 17 00:00:00 2001 From: calzoneman Date: Sat, 27 Jul 2013 10:52:17 -0400 Subject: [PATCH] Fix ACP unload channel bug --- acp.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/acp.js b/acp.js index 0a0650a0..899a058a 100644 --- a/acp.js +++ b/acp.js @@ -133,7 +133,7 @@ module.exports = function (Server) { }); user.socket.on("acp-channel-unload", function(data) { - if(Server.getChannel(data.name) !== undefined) { + if(Server.channelLoaded(data.name)) { var c = Server.getChannel(data.name); if(!c) return; @@ -145,9 +145,8 @@ module.exports = function (Server) { // At this point c should be unloaded // if it's still loaded, kill it - c = Server.getChannel(data.name); - if(c !== undefined) - Server.unload(c); + if(Server.channelLoaded(data.name)) + Server.unloadChannel(Server.getChannel(data.name)); } });