diff --git a/lib/routes/tencent/news/author.ts b/lib/routes/tencent/news/author.ts index c0bd95a0a19a7b..bb1169b4d673f9 100644 --- a/lib/routes/tencent/news/author.ts +++ b/lib/routes/tencent/news/author.ts @@ -68,17 +68,19 @@ async function handler(ctx) { .text() .match(/window\.DATA = ({.+});/)[1] ); - const $data = load(data.originContent.text, null, false); - - $data('*') - .contents() - .filter((_, elem) => elem.type === 'comment') - .replaceWith((_, elem) => - art(path.join(__dirname, '../templates/news/image.art'), { - attribute: elem.data.trim(), - originAttribute: data.originAttribute, - }) - ); + const $data = load(data.originContent?.text || '', null, false); + if ($data) { + // Not video page + $data('*') + .contents() + .filter((_, elem) => elem.type === 'comment') + .replaceWith((_, elem) => + art(path.join(__dirname, '../templates/news/image.art'), { + attribute: elem.data.trim(), + originAttribute: data.originAttribute, + }) + ); + } return { title,