From 1c6d7a6aaeab857b307d9a640ad0f80da408b524 Mon Sep 17 00:00:00 2001 From: Evangelos Skopelitis Date: Fri, 14 Jun 2024 10:27:53 -0400 Subject: [PATCH] frontend: MainInfoSection: Correctly handle null backLink This fix explicitly handles the null case in getBackLink() to ensure that no back button will be shown, as defined in MainInfoSectionProps. Fixes: #2033 Signed-off-by: Evangelos Skopelitis --- .../common/Resource/MainInfoSection/MainInfoSection.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/components/common/Resource/MainInfoSection/MainInfoSection.tsx b/frontend/src/components/common/Resource/MainInfoSection/MainInfoSection.tsx index 6649d35bc7d..3817f44a0fd 100644 --- a/frontend/src/components/common/Resource/MainInfoSection/MainInfoSection.tsx +++ b/frontend/src/components/common/Resource/MainInfoSection/MainInfoSection.tsx @@ -49,6 +49,10 @@ export function MainInfoSection(props: MainInfoSectionProps) { const header = typeof headerSection === 'function' ? headerSection(resource) : headerSection; function getBackLink() { + if (backLink === null) { + return false; + } + if (!!backLink || backLink === '') { return backLink; }