fix: crash when res.locals.linkTags is undefined

v1.18.x
Andrew Rodrigues 5 years ago committed by GitHub
parent 98b70c6b8e
commit 7cab2b0fea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -92,6 +92,7 @@ topicsController.get = async function getTopic(req, res, callback) {
topicData.pagination = pagination.create(currentPage, pageCount, req.query);
topicData.pagination.rel.forEach(function (rel) {
rel.href = nconf.get('url') + '/topic/' + topicData.slug + rel.href;
res.locals.linkTags = res.locals.linkTags || [];
res.locals.linkTags.push(rel);
});

Loading…
Cancel
Save