From a106050ba3c958b7099cc881f31b23517248e272 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 15 Jan 2018 09:41:18 -0700 Subject: [PATCH] Fix attempts to load bad path --- core/events.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/events.js b/core/events.js index 8e16a374..5febb463 100644 --- a/core/events.js +++ b/core/events.js @@ -48,17 +48,17 @@ module.exports = new class Events extends events.EventEmitter { } async.each(files, (moduleName, nextModule) => { - modulePath = paths.join(modulePath, moduleName); + const fullModulePath = paths.join(modulePath, moduleName); try { - const mod = require(modulePath); - + const mod = require(fullModulePath); + if(_.isFunction(mod.registerEvents)) { // :TODO: ... or just systemInit() / systemShutdown() & mods could call Events.on() / Events.removeListener() ? mod.registerEvents(this); } } catch(e) { - + Log.warn( { error : e }, 'Exception during module "registerEvents"'); } return nextModule(null);