mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-16 22:44:03 +02:00
Fix attempts to load bad path
This commit is contained in:
parent
90706f8798
commit
a106050ba3
1 changed files with 4 additions and 4 deletions
|
@ -48,17 +48,17 @@ module.exports = new class Events extends events.EventEmitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
async.each(files, (moduleName, nextModule) => {
|
async.each(files, (moduleName, nextModule) => {
|
||||||
modulePath = paths.join(modulePath, moduleName);
|
const fullModulePath = paths.join(modulePath, moduleName);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const mod = require(modulePath);
|
const mod = require(fullModulePath);
|
||||||
|
|
||||||
if(_.isFunction(mod.registerEvents)) {
|
if(_.isFunction(mod.registerEvents)) {
|
||||||
// :TODO: ... or just systemInit() / systemShutdown() & mods could call Events.on() / Events.removeListener() ?
|
// :TODO: ... or just systemInit() / systemShutdown() & mods could call Events.on() / Events.removeListener() ?
|
||||||
mod.registerEvents(this);
|
mod.registerEvents(this);
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
Log.warn( { error : e }, 'Exception during module "registerEvents"');
|
||||||
}
|
}
|
||||||
|
|
||||||
return nextModule(null);
|
return nextModule(null);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue