From 264a441c353da3698aebac9ef71f7544d59fa68f Mon Sep 17 00:00:00 2001 From: joostdecock Date: Sun, 11 Jun 2023 18:03:50 +0200 Subject: [PATCH] fix(shared): Check for text attributes before using them --- packages/react-components/src/pattern/text.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-components/src/pattern/text.mjs b/packages/react-components/src/pattern/text.mjs index 6c4e41aa8ab..29c3ccbfb68 100644 --- a/packages/react-components/src/pattern/text.mjs +++ b/packages/react-components/src/pattern/text.mjs @@ -39,7 +39,9 @@ export const TextOnPath = ({ path, pathId, t }) => { startOffset: '0%', } const translated = translateStrings(t, path.attributes.text) - const align = path.attributes.list['data-text-class'].join(' ') + const align = path.attributes.list['data-text-class'] + ? path.attributes.list['data-text-class'].join(' ') + : false if (align && align.indexOf('center') > -1) textPathProps.startOffset = '50%' else if (align && align.indexOf('right') > -1) textPathProps.startOffset = '100%'