diff --git a/lib/helpers.js b/lib/helpers.js index 39d8754..2e3275b 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -105,17 +105,18 @@ export const localFilePrepare = (fileName, currentPath) => { if (fileName !== '.' && fileName !== '..') { const fullName = Path.join(currentPath, fileName); - - const stats = fs.statSync(fullName); - file = { - name: fullName, - size: stats.size, - date: stats.mtime, - type: stats.isFile() ? 'f' : 'd', - }; - - if (!stats.isFile()) { - queue = fullName; + if (fs.existsSync(fullName)) { + const stats = fs.statSync(fullName); + file = { + name: fullName, + size: stats.size, + date: stats.mtime, + type: stats.isFile() ? 'f' : 'd', + }; + + if (!stats.isFile()) { + queue = fullName; + } } }