From 21cf29e73bbdfc878cdf1798c7fe1d45d56ceb68 Mon Sep 17 00:00:00 2001 From: Manh Hung Nguyen Date: Thu, 4 Jan 2024 13:24:05 +0700 Subject: [PATCH] Fix error when Richtext has no data Fixes: AFORM-3854 --- .../src/components/elements/ParagraphTextElementBlock.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/@episerver/forms-react/src/components/elements/ParagraphTextElementBlock.tsx b/src/@episerver/forms-react/src/components/elements/ParagraphTextElementBlock.tsx index 881535f..ebbdcdf 100644 --- a/src/@episerver/forms-react/src/components/elements/ParagraphTextElementBlock.tsx +++ b/src/@episerver/forms-react/src/components/elements/ParagraphTextElementBlock.tsx @@ -32,8 +32,8 @@ export const ParagraphTextElementBlock = (props: ParagraphTextElementBlockProps) } } - let text = element.properties.paragraphText - const placeHolders = extractTextsWithFormat(element.properties.paragraphText) + let text = element.properties.paragraphText ?? ""; + const placeHolders = extractTextsWithFormat(text) if (doReplaceText) { data.forEach(element => {