mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-31 19:15:58 +01:00
crash fix
This commit is contained in:
@@ -70,7 +70,7 @@ topicsController.get = function(req, res, next) {
|
||||
function (topicData, next) {
|
||||
var description = '';
|
||||
|
||||
if(topicData.posts.length) {
|
||||
if (topicData.posts[0] && topicData.posts[0].content) {
|
||||
description = S(topicData.posts[0].content).stripTags().decodeHTMLEntities().s;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ topicsController.get = function(req, res, next) {
|
||||
var ogImageUrl = '';
|
||||
if (topicData.thumb) {
|
||||
ogImageUrl = topicData.thumb;
|
||||
} else if(topicData.posts.length && topicData.posts[0].user && topicData.posts[0].user.picture){
|
||||
} else if(topicData.posts.length && topicData.posts[0] && topicData.posts[0].user && topicData.posts[0].user.picture){
|
||||
ogImageUrl = topicData.posts[0].user.picture;
|
||||
} else if(meta.config['brand:logo']) {
|
||||
ogImageUrl = meta.config['brand:logo'];
|
||||
|
||||
Reference in New Issue
Block a user