From aeec2be24f3d5698f16bb81dadae3f59084877dc Mon Sep 17 00:00:00 2001 From: marzavec Date: Thu, 3 Oct 2019 12:48:30 -0500 Subject: Outgoing Hook Fix + Package Changes --- server/src/serverLib/MainServer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'server') diff --git a/server/src/serverLib/MainServer.js b/server/src/serverLib/MainServer.js index c55b732..8ef5129 100644 --- a/server/src/serverLib/MainServer.js +++ b/server/src/serverLib/MainServer.js @@ -363,10 +363,12 @@ class MainServer extends WsServer { // notify each module to register their hooks (if any) this.core.commands.initCommandHooks(this); + let curHooks = []; + let hookObj = []; + if (typeof this.hooks['in'] !== 'undefined') { // start sorting, with incoming first - let curHooks = [ ...this.hooks['in'].keys() ]; - let hookObj = []; + curHooks = [ ...this.hooks['in'].keys() ]; for (let i = 0, j = curHooks.length; i < j; i++) { hookObj = this.hooks['in'].get(curHooks[i]); hookObj.sort( (h1, h2) => h1.priority - h2.priority ); -- cgit v1.2.1