diff --git a/api/lib/parse/getCitations.js b/api/lib/parse/getCitations.js index f4086a4e9e..0e36de695e 100644 --- a/api/lib/parse/getCitations.js +++ b/api/lib/parse/getCitations.js @@ -2,7 +2,8 @@ const regex = / \[.*?]\(.*?\)/g; const getCitations = (res) => { - const textBlocks = res.details.adaptiveCards[0].body; + const adaptiveCards = res.details.adaptiveCards; + const textBlocks = adaptiveCards && adaptiveCards[0].body; if (!textBlocks) return ''; let links = textBlocks[textBlocks.length - 1]?.text.match(regex); if (links?.length === 0 || !links) return '';