Skip to content

TagSpaces is an offline, open source, document manager with tagging support

optimizing the formatfilesize function

uggrockddd32675a66d
diff --git a/data/js/tagutils.js b/data/js/tagutils.js
index dc0f6bd8e..2c145eb19 100644
--- a/data/js/tagutils.js
+++ b/data/js/tagutils.js
@@ -121,6 +121,9 @@ define(function(require, exports, module) {
function formatFileSize(sizeInBytes, siSystem) {
var threshold = siSystem ? 1000 : 1024;
+ if(!sizeInBytes) {
+ return "";
+ }
if (sizeInBytes < threshold) {
return sizeInBytes + ' B';
}