Skip to content

Commit b0b699e

Browse files
shibbasanfibiacreativa
authored andcommitted
fix: ask next question parsing to handle no match for next questions
1 parent ff1140f commit b0b699e

File tree

1 file changed

+1
-1
lines changed
  • packages/chat-component/src/utils

1 file changed

+1
-1
lines changed

packages/chat-component/src/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function processText(inputText: string, arrays: Array<Array<string> | Arr
4646

4747
// Determine which regex to use, depending if the indicator is present
4848
const nextRegex = hasNextQuestions ? findNextQuestions : findQuestionsbyDoubleArrow;
49-
const nextQuestionsMatch = replacedText.match(nextRegex);
49+
const nextQuestionsMatch = replacedText.match(nextRegex) ?? [];
5050
let nextQuestions: string[] = [];
5151
nextQuestions = cleanUpFollowUp([...(nextQuestionsMatch as string[])]);
5252

0 commit comments

Comments
 (0)