From 23db2e5c9e606a0781cf698d4572449d6bc6d728 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Sat, 24 Aug 2013 18:47:10 -0400 Subject: [PATCH] better fix for #198 --- src/webserver.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/webserver.js b/src/webserver.js index ff0aa67221..5ddb6b3302 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -222,14 +222,11 @@ var express = require('express'), } async.waterfall([ - function(next) { - topics.getTopicField(tid, 'deleted', function(err, deleted) { - if(deleted === '1') - return next(1, null); - }); - }, 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); + next(err, topicData); }); },