ldn-inbox-server 1.4.6 → 1.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/util.js +8 -1
- package/package.json +1 -1
package/lib/util.js
CHANGED
|
@@ -118,7 +118,14 @@ function dynamic_handler(handler,fallback) {
|
|
|
118
118
|
logger.debug(`trying dynamic load of ${handler} -> ${abs_handler}`);
|
|
119
119
|
delete require.cache[abs_handler];
|
|
120
120
|
const func = require(abs_handler).handle;
|
|
121
|
-
|
|
121
|
+
|
|
122
|
+
if (func) {
|
|
123
|
+
return func;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
logger.error(`no "handle" method found in ${handler}.module.exports`);
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
122
129
|
}
|
|
123
130
|
}
|
|
124
131
|
else {
|