From 4515e69bd65b5982134e1d6202b307b422929980 Mon Sep 17 00:00:00 2001 From: AlirezaYousefpour <93353496+AlirezaYousefpourM@users.noreply.github.com> Date: Tue, 14 Jan 2025 22:41:17 +0330 Subject: [PATCH] Update useWorkshopsPage.js --- frontend/src/pages/workshops/useWorkshopsPage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/workshops/useWorkshopsPage.js b/frontend/src/pages/workshops/useWorkshopsPage.js index 24092d9..0e30e38 100644 --- a/frontend/src/pages/workshops/useWorkshopsPage.js +++ b/frontend/src/pages/workshops/useWorkshopsPage.js @@ -94,11 +94,11 @@ export default function useWorkshopsPage() { const presenters = []; if (workshop.teachers) { workshop.teachers.forEach((item) => { - presenters.push(teachersData.filter((el) => el.id === item)[0].name); + presenters.push(teachersData.filter((el) => el.id === item)?.[0]?.name); }); } else { workshop.presenters.forEach((item) => { - presenters.push(presenterData.filter((el) => el.id === item)[0].name); + presenters.push(presenterData.filter((el) => el.id === item)?.[0]?.name); }); } item.presenters = presenters;