Skip to content

Commit 14103f2

Browse files
author
joeltaylor
committed
Better 404 handling for news page
1 parent 3be8512 commit 14103f2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

server/routes/news.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,13 @@ router.
231231
}
232232

233233
Articles.findBySlug(req.params.slug, function(flow) {
234-
Comments.findByArticleId(flow[0].id, function(comments) {
235-
if (flow.length > 0){
234+
if (flow.length > 0){
235+
Comments.findByArticleId(flow[0].id, function(comments) {
236236
res.render('news/show', { flow: flow[0], comments: comments, user: user, token: req.csrfToken(), moment: moment, pluralize: pluralize });
237-
}else{
237+
});
238+
}else{
238239
res.render('404');
239-
}
240-
});
240+
}
241241
});
242242
}).
243243

0 commit comments

Comments
 (0)