check if topicData is valid

v1.18.x
Baris Soner Usakli 12 years ago
parent 23db2e5c9e
commit dd40cbc139

@ -224,8 +224,10 @@ var express = require('express'),
async.waterfall([
function(next) {
topics.getTopicWithPosts(tid, ((req.user) ? req.user.uid : 0), function(err, topicData) {
if(topicData.deleted === '1' && topicData.expose_tools === 0)
return next(new Error('Topic deleted'), null);
if(topicData) {
if(topicData.deleted === '1' && topicData.expose_tools === 0)
return next(new Error('Topic deleted'), null);
}
next(err, topicData);
});

Loading…
Cancel
Save