From c04723373e4a5bfe236beae9a4c827fa819f6509 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Fri, 12 Jul 2024 14:53:57 +0100 Subject: [PATCH] fix: frontend fails to load when announcement flag isn't set (#4329) --- frontend/web/components/Announcement.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/web/components/Announcement.tsx b/frontend/web/components/Announcement.tsx index 291aebc53c6e..f5062eacc1d8 100644 --- a/frontend/web/components/Announcement.tsx +++ b/frontend/web/components/Announcement.tsx @@ -20,6 +20,11 @@ const Announcement: FC = () => { } const announcementValue = Utils.getFlagsmithJSONValue('announcement', null) + + if (!announcementValue) { + return null + } + const { buttonText, description, id, isClosable, title, url } = announcementValue as AnnouncementValueType const dismissed = flagsmith.getTrait('dismissed_announcement')