Skip to content

Commit b12f3fb

Browse files
authored
fix(route/apnews): Tackle occasionally missing keywords in ld-json. (#16096)
1 parent 0126dbc commit b12f3fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/routes/apnews/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function fetchArticle(item) {
2525
pubDate: parseDate(ldjson.datePublished),
2626
updated: parseDate(ldjson.dateModified),
2727
description: $('div.RichTextStoryBody').html(),
28-
category: [`section:${$("meta[property='article:section']").attr('content')}`, ...ldjson.keywords],
28+
category: [`section:${$("meta[property='article:section']").attr('content')}`, ...(ldjson.keywords ?? [])],
2929
guid: $("meta[name='brightspot.contentId']").attr('content'),
3030
author: ldjson.author,
3131
...item,

0 commit comments

Comments
 (0)