Skip to content

Node.js based forum software built for the modern web

added check for undefined, null empty string

Baris Soner Usakli9879f645f61f
diff --git a/public/src/utils.js b/public/src/utils.js
index ce2bf395e0..9f987b5ef0 100644
--- a/public/src/utils.js
+++ b/public/src/utils.js
@@ -185,12 +185,16 @@
},
toISOString: function(timestamp) {
+ if(!timestamp) {
+ return '';
+ }
+
try {
return new Date(parseInt(timestamp, 10)).toISOString();
} catch(e){
- console.log(e.message);
+ console.log(timestamp, e.stack);
}
- return new Date(parseInt(0, 10)).toISOString();
+ return '';
}
};