mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
added check for undefined, null empty string
This commit is contained in:
@@ -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 '';
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user