Fix ACP unload channel bug

This commit is contained in:
calzoneman 2013-07-27 10:52:17 -04:00
parent 9084a1aa8c
commit 5dfd9ad310
1 changed files with 3 additions and 4 deletions

7
acp.js
View File

@ -133,7 +133,7 @@ module.exports = function (Server) {
}); });
user.socket.on("acp-channel-unload", function(data) { 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); var c = Server.getChannel(data.name);
if(!c) if(!c)
return; return;
@ -145,9 +145,8 @@ module.exports = function (Server) {
// At this point c should be unloaded // At this point c should be unloaded
// if it's still loaded, kill it // if it's still loaded, kill it
c = Server.getChannel(data.name); if(Server.channelLoaded(data.name))
if(c !== undefined) Server.unloadChannel(Server.getChannel(data.name));
Server.unload(c);
} }
}); });