error checks for missing after

v1.18.x
Baris Soner Usakli 11 years ago
parent 6a78221261
commit 3c273f4a66

@ -229,7 +229,7 @@ SocketTopics.follow = function(socket, tid, callback) {
};
SocketTopics.loadMore = function(socket, data, callback) {
if(!data || !data.tid) {
if(!data || !data.tid || !data.after) {
return callback(new Error('invalid data'));
}
@ -252,7 +252,7 @@ SocketTopics.loadMore = function(socket, data, callback) {
};
SocketTopics.loadMoreRecentTopics = function(socket, data, callback) {
if(!data || !data.term) {
if(!data || !data.term || !data.after) {
return callback(new Error('invalid data'));
}
@ -263,6 +263,10 @@ SocketTopics.loadMoreRecentTopics = function(socket, data, callback) {
};
SocketTopics.loadMoreUnreadTopics = function(socket, data, callback) {
if(!data || !data.after) {
return callback(new Error('invalid data'));
}
var start = parseInt(data.after, 10),
end = start + 9;

Loading…
Cancel
Save