Skip to content

Commit 8c39c4d

Browse files
committed
Fix frontend exception when announcement not set
1 parent b32a6ca commit 8c39c4d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

frontend/web/components/Announcement.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ const Announcement: FC<AnnouncementType> = () => {
2020
}
2121

2222
const announcementValue = Utils.getFlagsmithJSONValue('announcement', null)
23+
24+
if (!announcementValue) {
25+
return null
26+
}
27+
2328
const { buttonText, description, id, isClosable, title, url } =
2429
announcementValue as AnnouncementValueType
2530
const dismissed = flagsmith.getTrait('dismissed_announcement')

0 commit comments

Comments
 (0)