dont go below 0

This commit is contained in:
Baris Usakli
2018-03-06 16:37:35 -05:00
parent 917cbc9273
commit a5cceabc89

View File

@@ -96,7 +96,7 @@ function filesToData(currentDir, files, callback) {
name: file,
path: path.join(currentDir, file).replace(nconf.get('upload_path'), ''),
url: url,
fileCount: filesInDir.length - 1, // ignore .gitignore
fileCount: Math.max(0, filesInDir.length - 1), // ignore .gitignore
size: stat.size,
sizeHumanReadable: (stat.size / 1024).toFixed(1) + 'KiB',
isDirectory: stat.isDirectory(),