check result for null

v1.18.x
Baris Soner Usakli 11 years ago
parent e6a9f5a704
commit 22e1b0f22e

@ -279,12 +279,7 @@ var path = require('path'),
return callback(err, null);
}
posts.getPostSummaryByPids(pids, false, function (err, posts) {
if (err){
return callback(err, null);
}
callback(null, posts);
});
posts.getPostSummaryByPids(pids, false, callback);
});
}
@ -294,12 +289,7 @@ var path = require('path'),
return callback(err, null);
}
topics.getTopicsByTids(tids, 0, 0, function (err, topics) {
if (err){
return callback(err, null);
}
callback(null, topics);
});
topics.getTopicsByTids(tids, 0, 0, callback);
});
}
@ -309,6 +299,10 @@ var path = require('path'),
return next(err);
}
if(!results) {
results[0] = results[1] = [];
}
return res.json({
show_no_topics: results[1].length ? 'hide' : '',
show_no_posts: results[0].length ? 'hide' : '',

Loading…
Cancel
Save