aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-05-24 16:55:59 +0200
committerDennis Eriksen <dennis.se@gmail.com>2013-05-24 16:55:59 +0200
commit00942cdd9e77aeaeed6df60e6267dd7dd105e243 (patch)
treedad4b48489dd350b459016798a4f0fbbcbdb3b02
parentno longer redirect to /test on failurewq (diff)
downloadDivid-00942cdd9e77aeaeed6df60e6267dd7dd105e243.tar.gz
fixed small bug in 4cec8e5
-rw-r--r--controllers/system.js2
1 files changed, 1 insertions, 1 deletions
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 });