mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 07:25:46 +01:00
added check for undefined, null empty string
This commit is contained in:
@@ -185,12 +185,16 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
toISOString: function(timestamp) {
|
toISOString: function(timestamp) {
|
||||||
|
if(!timestamp) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return new Date(parseInt(timestamp, 10)).toISOString();
|
return new Date(parseInt(timestamp, 10)).toISOString();
|
||||||
} catch(e){
|
} 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