Improve error handling.

This commit is contained in:
Khaos Tian
2016-11-27 15:24:27 -08:00
parent 4d0f9d86f6
commit e1867b2bc0

View File

@@ -165,9 +165,13 @@ Plugin.installed = function() {
// reconstruct full path // reconstruct full path
var pluginPath = path.join(requirePath, name); var pluginPath = path.join(requirePath, name);
// we only care about directories try {
if (!fs.statSync(pluginPath).isDirectory()) continue; // we only care about directories
if (!fs.statSync(pluginPath).isDirectory()) continue;
} catch (e) {
continue;
}
// does this module contain a package.json? // does this module contain a package.json?
var pjson; var pjson;