Safety check if plugin actually has exports before attempting to export functions
Ryan Blenis committed
Nov 24, 2019 at 19:19 UTC
d3cdd0703b187d83160ee60d219b6c66ccee21e2
1 file changed
+4
-2
pluginHandler.js
+4
-2
@@ -66,8 +66,10 @@ module.exports.pluginHandler = function (parent) {
66
67
for (const p of Object.keys(obj.plugins)) {
68
str += ' obj.' + p + ' = {};\r\n';
69
- for (const l of Object.values(obj.exports[p])) {
70
- str += ' obj.' + p + '.' + l + ' = ' + obj.plugins[p][l].toString() + '\r\n';
69
+ if (Array.isArray(obj.exports[p])) {
70
+ for (const l of Object.values(obj.exports[p])) {
71
+ str += ' obj.' + p + '.' + l + ' = ' + obj.plugins[p][l].toString() + '\r\n';
72
+ }
73
}
74
}
75