From e1867b2bc0fb68fe09adcece40cfc239245f2f94 Mon Sep 17 00:00:00 2001 From: Khaos Tian Date: Sun, 27 Nov 2016 15:24:27 -0800 Subject: [PATCH] Improve error handling. --- lib/plugin.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/plugin.js b/lib/plugin.js index e7e9c1f..3b3d1e5 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -165,9 +165,13 @@ Plugin.installed = function() { // reconstruct full path var pluginPath = path.join(requirePath, name); - - // we only care about directories - if (!fs.statSync(pluginPath).isDirectory()) continue; + + try { + // we only care about directories + if (!fs.statSync(pluginPath).isDirectory()) continue; + } catch (e) { + continue; + } // does this module contain a package.json? var pjson;