diff --git a/packages/node_modules/@node-red/nodes/core/storage/23-watch.js b/packages/node_modules/@node-red/nodes/core/storage/23-watch.js index e43317bb4..9b6c4bc62 100644 --- a/packages/node_modules/@node-red/nodes/core/storage/23-watch.js +++ b/packages/node_modules/@node-red/nodes/core/storage/23-watch.js @@ -23,9 +23,13 @@ module.exports = function(RED) { var getAllDirs = function (dir, filelist) { filelist = filelist || []; fs.readdirSync(dir).forEach(file => { - if (fs.statSync(path.join(dir, file)).isDirectory() ) { - filelist.push(path.join(dir, file)); - getAllDirs(path.join(dir, file), filelist); + try { + if (fs.statSync(path.join(dir, file)).isDirectory() ) { + filelist.push(path.join(dir, file)); + getAllDirs(path.join(dir, file), filelist); + } + } catch (error) { + //should we raise an error? } }); return filelist;