From 00942cdd9e77aeaeed6df60e6267dd7dd105e243 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Fri, 24 May 2013 16:55:59 +0200 Subject: fixed small bug in 4cec8e5 --- controllers/system.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'controllers/system.js') diff --git a/controllers/system.js b/controllers/system.js index 647d5bb..12bef2a 100644 --- a/controllers/system.js +++ b/controllers/system.js @@ -269,7 +269,7 @@ exports.deleteProjectPost = function(req, res) { if (err) return res.status(500).render('error', { title: '500', text: 'En serverfeil oppstod', error: err.stack }); if (!access) return res.status(403).render('error', { title: '403', text: 'Du har ikke tilgang til å gjøre dette' }); pPost.load(req.params.post, function(err, post) { - if (err) return res.status(500).render('error', { title: '500', text: 'En serverfeil oppstod', error: err.stack }); + if (err || !post) return res.status(500).render('error', { title: '500', text: 'En serverfeil oppstod', error: err }); if (post.user._id === req.user._id || access.permissions >= 6) { pPost.remove({ _id: post._id }, function(err) { if (err) return res.status(500).render('error', { title: '500', text: 'En serverfeil oppstod', error: err.stack }); -- cgit v1.2.3