diff --git a/packages/settings/src/index.ts b/packages/settings/src/index.ts index 6ae6336e..8e2a6725 100644 --- a/packages/settings/src/index.ts +++ b/packages/settings/src/index.ts @@ -8,11 +8,13 @@ const getTimePermission = () => { const currentTimeIsBiggerThanStart = currentSettings.startTime && - currentTime >= currentSettings.startTime.getTime(); + currentSettings.startTime ? + currentTime >= currentSettings.startTime.getTime() : false; const currentTimeIsSmallerThanEnd = currentSettings.startTime && - currentTime <= currentSettings.endTime.getTime(); + currentSettings.endTime ? + currentTime <= currentSettings.endTime.getTime() : false; return { isPermittedByTime: