From b2dfccf86999b170b9deb22f1feefeb98f932960 Mon Sep 17 00:00:00 2001 From: adam-skowronek Date: Thu, 17 Nov 2022 23:37:05 +0100 Subject: [PATCH] Fix if statement --- frontend/src/views/coordinator/Schedule.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/coordinator/Schedule.tsx b/frontend/src/views/coordinator/Schedule.tsx index 044d907..e9a184e 100644 --- a/frontend/src/views/coordinator/Schedule.tsx +++ b/frontend/src/views/coordinator/Schedule.tsx @@ -220,7 +220,10 @@ const Schedule = () => { ) useEffect(() => { - if (scheduleData) { + if ( + scheduleData?.start_date_for_enrollment_students && + scheduleData?.end_date_for_enrollment_students + ) { setStartDate(new Date(scheduleData.start_date_for_enrollment_students)) setEndDate(new Date(scheduleData.end_date_for_enrollment_students)) }