From 1cea314de0ea1b90a528e0f163da018b63d9f742 Mon Sep 17 00:00:00 2001 From: Ken Date: Mon, 2 Sep 2024 10:33:47 +0200 Subject: [PATCH] bug: Avoid RelatertInnhold from erroring when empty --- .../sanity-modules/relatert-innhold/RelatertInnhold.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aksel.nav.no/website/components/sanity-modules/relatert-innhold/RelatertInnhold.tsx b/aksel.nav.no/website/components/sanity-modules/relatert-innhold/RelatertInnhold.tsx index 9155cc25e5..0e2434af54 100644 --- a/aksel.nav.no/website/components/sanity-modules/relatert-innhold/RelatertInnhold.tsx +++ b/aksel.nav.no/website/components/sanity-modules/relatert-innhold/RelatertInnhold.tsx @@ -10,7 +10,7 @@ type RelatertInnholdProps = { }; const RelatertInnhold = ({ node }: RelatertInnholdProps) => { - if (!node || node?.lenker?.length === 0) { + if (!node || !node.lenker || node?.lenker?.length === 0) { return null; }