From 40bd4fd1dd3773e0f6e5f0b450b81537012a772e Mon Sep 17 00:00:00 2001 From: Robbert Broersma Date: Thu, 12 Dec 2024 18:16:46 +0100 Subject: [PATCH] fix: prevent undefined error --- src/components/ComponentPage.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/ComponentPage.tsx b/src/components/ComponentPage.tsx index f0e97578496..2f456980a09 100644 --- a/src/components/ComponentPage.tsx +++ b/src/components/ComponentPage.tsx @@ -167,9 +167,8 @@ export const Implementations = ({ component, headingLevel }: ComponentPageSectio export const HelpImproveComponent = ({ component }: ComponentPageSectionProps) => { const DISCUSSION_URL_COLUMN_ID = 'PVTF_lADOBGdlVM4AdX8lzgcig7o'; - const DiscussionUrl = component?.projects - .find((project) => project.id === 'HELP_WANTED') - .tasks.find((task) => task.id === DISCUSSION_URL_COLUMN_ID).value; + const project = component?.projects.find((project) => project.id === 'HELP_WANTED'); + const DiscussionUrl = project?.tasks.find((task) => task.id === DISCUSSION_URL_COLUMN_ID).value; return ( component && (