fixed the redis error when going to unread/recent if nextStart is missing

This commit is contained in:
Baris Soner Usakli
2014-02-22 00:49:32 -05:00
parent f4d23fe5df
commit bae76ebd70
3 changed files with 18 additions and 19 deletions

View File

@@ -287,6 +287,9 @@ var path = require('path'),
app.get('/unread', function (req, res, next) {
var uid = (req.user) ? req.user.uid : 0;
if(!req.user) {
return res.json(403, 'not-allowed');
}
topics.getUnreadTopics(uid, 0, 19, function (err, data) {
if(err) {
return next(err);
@@ -298,6 +301,9 @@ var path = require('path'),
app.get('/unread/total', function (req, res, next) {
var uid = (req.user) ? req.user.uid : 0;
if(!req.user) {
return res.json(403, 'not-allowed');
}
topics.getTotalUnread(uid, function (err, data) {
if(err) {
return next(err);