diff --git a/frontend/src/components/home/Dashboard.tsx b/frontend/src/components/home/Dashboard.tsx index 18a8fe1e85..ff61e428d8 100644 --- a/frontend/src/components/home/Dashboard.tsx +++ b/frontend/src/components/home/Dashboard.tsx @@ -144,7 +144,7 @@ const HomeDashBoard: React.FC = () => { const fetchTestSections = (res) => { setTestSections(res); - setSelectedTestSection(res[0].id); + setSelectedTestSection(res[0]?.id); }; const loadNextResultsPage = () => { @@ -316,7 +316,7 @@ const HomeDashBoard: React.FC = () => { setSelectedTile(tile); } else { setSelectedTile(null); - setSelectedTestSection(testSections[0].id); + setSelectedTestSection(testSections[0]?.id); } }; @@ -514,7 +514,7 @@ const HomeDashBoard: React.FC = () => { - {testSections.map((item, idx) => { + {testSections?.map((item, idx) => { return (