From f665cf0373c3022d928946caae3fc94e197a4a7d Mon Sep 17 00:00:00 2001 From: dvelo <52332868+DeveloLongScript@users.noreply.github.com> Date: Wed, 15 Jan 2025 21:16:57 -0600 Subject: [PATCH] fix: crash --- src/components/feat/LayoutPart.tsx | 38 ++++++++++++++++-------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/components/feat/LayoutPart.tsx b/src/components/feat/LayoutPart.tsx index 6b86be1..406d919 100644 --- a/src/components/feat/LayoutPart.tsx +++ b/src/components/feat/LayoutPart.tsx @@ -48,24 +48,26 @@ export default function LayoutPart({ - {!loading && incidents !== null && ( -
- - { - ( - incidents[0] as { - attributes: { title: string }; - } - ).attributes.title - }{" "} - {" "} - - MHSF may be down -
- - View MHSF Status - -
- )} + {!loading && + incidents !== null && + (incidents as Array).length > 0 && ( +
+ + { + ( + incidents[0] as { + attributes: { title: string }; + } + ).attributes.title + }{" "} + {" "} + - MHSF may be down +
+ + View MHSF Status + +
+ )}