From 4daf9db9db5b8e8c3391aece7ea86e614daf25b8 Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Mon, 15 Apr 2024 18:53:41 +0100 Subject: [PATCH] fix: acme.cal.local crashes due to missing requestedSlug in seed (#14592) --- apps/web/lib/team/[slug]/getServerSideProps.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/web/lib/team/[slug]/getServerSideProps.tsx b/apps/web/lib/team/[slug]/getServerSideProps.tsx index 18d6df4a5b..a094a923b7 100644 --- a/apps/web/lib/team/[slug]/getServerSideProps.tsx +++ b/apps/web/lib/team/[slug]/getServerSideProps.tsx @@ -213,6 +213,9 @@ function getTeamWithoutMetadata>(team: T) { const teamMetadata = teamMetadataSchema.parse(metadata); return { ...rest, - requestedSlug: teamMetadata?.requestedSlug, + // add requestedSlug if available. + ...(typeof teamMetadata?.requestedSlug !== "undefined" + ? { requestedSlug: teamMetadata?.requestedSlug } + : {}), }; }