From e754cfbacf2acf780cbc7f605331199ecc5da989 Mon Sep 17 00:00:00 2001 From: Ryan Blenis Date: Sun, 24 Nov 2019 19:19:46 -0500 Subject: [PATCH] Safety check if plugin actually has exports before attempting to export functions --- pluginHandler.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pluginHandler.js b/pluginHandler.js index e8b3da5c..bf8e2958 100644 --- a/pluginHandler.js +++ b/pluginHandler.js @@ -66,8 +66,10 @@ module.exports.pluginHandler = function (parent) { for (const p of Object.keys(obj.plugins)) { str += ' obj.' + p + ' = {};\r\n'; - for (const l of Object.values(obj.exports[p])) { - str += ' obj.' + p + '.' + l + ' = ' + obj.plugins[p][l].toString() + '\r\n'; + if (Array.isArray(obj.exports[p])) { + for (const l of Object.values(obj.exports[p])) { + str += ' obj.' + p + '.' + l + ' = ' + obj.plugins[p][l].toString() + '\r\n'; + } } }