small fixes to search

This commit is contained in:
Baris Usakli
2013-09-23 15:31:52 -04:00
parent aa6eff4c54
commit bae9f46d8b
3 changed files with 4 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ var RDB = require('./redis.js'),
Posts.getPostFields(pid, ['pid', 'tid', 'content', 'uid', 'timestamp', 'deleted'], function(postData) {
if (postData.deleted === '1') return callback(null);
else {
postData.relativeTime = new Date(parseInt(postData.timestamp, 10)).toISOString();
postData.relativeTime = new Date(parseInt(postData.timestamp || 0, 10)).toISOString();
next(null, postData);
}
});