mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 15:30:39 +01:00
fix for topics without category data (?)
@barisusakli lemme know if this is legit, if not, see line 195 as well
This commit is contained in:
@@ -201,17 +201,20 @@ topicsController.get = function(req, res, next) {
|
||||
rel: 'alternate',
|
||||
type: 'application/rss+xml',
|
||||
href: nconf.get('url') + '/topic/' + tid + '.rss'
|
||||
},
|
||||
{
|
||||
rel: 'up',
|
||||
href: nconf.get('url') + '/category/' + topicData.category.slug
|
||||
},
|
||||
}
|
||||
{
|
||||
rel: 'canonical',
|
||||
href: nconf.get('url') + '/topic/' + topicData.slug
|
||||
}
|
||||
];
|
||||
|
||||
if (topicData.category) {
|
||||
res.locals.linkTags.push({
|
||||
rel: 'up',
|
||||
href: nconf.get('url') + '/category/' + topicData.category.slug
|
||||
});
|
||||
}
|
||||
|
||||
next(null, topicData);
|
||||
}
|
||||
], function (err, data) {
|
||||
|
||||
Reference in New Issue
Block a user