Safe property access in fallback

This commit is contained in:
Alex Holliday committed 2025-01-28 15:38:14 -08:00
1 parent 067d457b96
commit 577c0b5d19
1 file changed
+5 -3
+5 -3
View File
@@ -32,12 +32,14 @@ const Fallback = ({ title, checks, link = "/", isAdmin, vowelStart = false }) =>
border={1} border={1}
borderColor={theme.palette.primary.lowContrast} borderColor={theme.palette.primary.lowContrast}
borderRadius={theme.shape.borderRadius} borderRadius={theme.shape.borderRadius}
borderStyle="dashed"
backgroundColor={theme.palette.primary.main} backgroundColor={theme.palette.primary.main}
overflow="hidden" overflow="hidden"
sx={{
borderStyle: "dashed",
}}
> >
<Stack <Stack
className={`fallback__${title.trim().split(" ")[0]}`} className={`fallback__${title?.trim().split(" ")[0]}`}
alignItems="center" alignItems="center"
gap={theme.spacing(20)} gap={theme.spacing(20)}
> >
@@ -68,7 +70,7 @@ const Fallback = ({ title, checks, link = "/", isAdmin, vowelStart = false }) =>
> >
{vowelStart ? "An" : "A"} {title} is used to: {vowelStart ? "An" : "A"} {title} is used to:
</Typography> </Typography>
{checks.map((check, index) => ( {checks?.map((check, index) => (
<Check <Check
text={check} text={check}
key={`${title.trim().split(" ")[0]}-${index}`} key={`${title.trim().split(" ")[0]}-${index}`}