From e37d1eadcd71be342a4baab08704bd2be376e222 Mon Sep 17 00:00:00 2001 From: Matt Aitken Date: Thu, 6 Jul 2023 19:29:00 +0100 Subject: [PATCH] Breadcrumb null checks in case error boundaries are hit deep in the app --- .../app/components/navigation/Breadcrumb.tsx | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/apps/webapp/app/components/navigation/Breadcrumb.tsx b/apps/webapp/app/components/navigation/Breadcrumb.tsx index c8a727f04..09a63c134 100644 --- a/apps/webapp/app/components/navigation/Breadcrumb.tsx +++ b/apps/webapp/app/components/navigation/Breadcrumb.tsx @@ -102,73 +102,77 @@ function BreadcrumbItem({ case "projects": return ; case "jobs": + if (!organization || !project) return null; return ( ); case "environments": + if (!organization || !project) return null; return ( ); case "integrations": + if (!organization || !project) return null; return ( ); case "integration": + if (!organization || !project || !client) return null; return ( ); case "integration-job": + if (!organization || !project || !client) return null; return ( ); case "integration-connections": + if (!organization || !project || !client) return null; return ( ); case "integration-scopes": + if (!organization || !project || !client) return null; return ( ); case "job": + if (!organization || !project || !job) return null; return ( @@ -176,32 +180,35 @@ function BreadcrumbItem({ ); case "test": + if (!organization || !project || !job) return null; return ( ); case "runs": + if (!organization || !project || !job) return null; return ( ); case "run": + if (!organization || !project || !job || !run) return null; return ( );