Check if plugin directory is a directory

This commit is contained in:
Samuel Elliott 2018-01-25 16:49:02 +00:00
parent d11cfbcdaa
commit a27d586d38
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
1 changed files with 6 additions and 3 deletions

View File

@ -142,6 +142,9 @@ class PluginManager extends Module {
try {
pluginPath = path.join(this.pluginsPath, pluginPath);
// Make sure this is a directory
await FileUtils.directoryExists(pluginPath);
if (!reload) {
const loaded = plugins.find(plugin => plugin.pluginPath === pluginPath);
if (loaded) {
@ -269,4 +272,4 @@ async function pluginManager(pluginName) {
if (window.bdTests) window.bdTests.pluginManager = pluginManager;
else window.bdTests = { pluginManager };
module.exports = { PluginManager: _instance, Plugin }
module.exports = { PluginManager: _instance, Plugin };