Fix ACP unload channel bug
This commit is contained in:
parent
9084a1aa8c
commit
5dfd9ad310
7
acp.js
7
acp.js
|
@ -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);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue