aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/controllers/system.js
diff options
context:
space:
mode:
Diffstat (limited to 'controllers/system.js')
-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 });