diff --git a/packages/volto-light-theme/news/445.bugfix b/packages/volto-light-theme/news/445.bugfix new file mode 100644 index 00000000..7c136074 --- /dev/null +++ b/packages/volto-light-theme/news/445.bugfix @@ -0,0 +1 @@ +Fixed footerlinks error if the link is created but not set. @sneridagh diff --git a/packages/volto-light-theme/src/components/Footer/FooterLinks.tsx b/packages/volto-light-theme/src/components/Footer/FooterLinks.tsx index 79c10ce4..a48bec1f 100644 --- a/packages/volto-light-theme/src/components/Footer/FooterLinks.tsx +++ b/packages/volto-light-theme/src/components/Footer/FooterLinks.tsx @@ -14,8 +14,11 @@ const FooterLinks = (props: FooterLinksProps) => { {!isEmpty(links?.blocks) ? links.blocks_layout.items.map((itemId) => { const link = links.blocks[itemId]; + + if (isEmpty(link) || !link.href) return null; + const title = link.title || link.href[0]['title']; - const href = flattenToAppURL(link.href[0]['@id']); + const href = flattenToAppURL(link.href[0]?.['@id']); if (!href) return null;