mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 13:36:01 +01:00
dont go below 0
This commit is contained in:
@@ -96,7 +96,7 @@ function filesToData(currentDir, files, callback) {
|
|||||||
name: file,
|
name: file,
|
||||||
path: path.join(currentDir, file).replace(nconf.get('upload_path'), ''),
|
path: path.join(currentDir, file).replace(nconf.get('upload_path'), ''),
|
||||||
url: url,
|
url: url,
|
||||||
fileCount: filesInDir.length - 1, // ignore .gitignore
|
fileCount: Math.max(0, filesInDir.length - 1), // ignore .gitignore
|
||||||
size: stat.size,
|
size: stat.size,
|
||||||
sizeHumanReadable: (stat.size / 1024).toFixed(1) + 'KiB',
|
sizeHumanReadable: (stat.size / 1024).toFixed(1) + 'KiB',
|
||||||
isDirectory: stat.isDirectory(),
|
isDirectory: stat.isDirectory(),
|
||||||
|
|||||||
Reference in New Issue
Block a user