From 1194e93a7e27d6cdcdee2f715afaa0ad1d959124 Mon Sep 17 00:00:00 2001 From: Sanjeev Lakhwani Date: Mon, 19 Aug 2024 11:55:05 -0400 Subject: [PATCH] added handling for null edge case --- src/js/components/ChooseProjectModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/components/ChooseProjectModal.tsx b/src/js/components/ChooseProjectModal.tsx index e4244fab..a90dfc53 100644 --- a/src/js/components/ChooseProjectModal.tsx +++ b/src/js/components/ChooseProjectModal.tsx @@ -9,7 +9,7 @@ const ChooseProjectModal = ({ isModalOpen, setIsModalOpen }: ChooseProjectModalP const t = useTranslationCustom(); const location = useLocation(); const { projects, selectedScope } = useAppSelector((state) => state.metadata); - const [selectedProject, setSelectedProject] = useState(selectedScope.project ?? projects[0].identifier); + const [selectedProject, setSelectedProject] = useState(selectedScope.project ?? projects[0]?.identifier ?? null); const baseURL = '/' + location.pathname.split('/')[1];