From 6118e158544e9d86722aac7cd57b552ed344960d Mon Sep 17 00:00:00 2001 From: kernoeb Date: Fri, 19 Jan 2024 22:53:42 +0100 Subject: [PATCH] Update calendar.js --- server/routes/calendar.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/routes/calendar.js b/server/routes/calendar.js index c0d9a78..7441dae 100644 --- a/server/routes/calendar.js +++ b/server/routes/calendar.js @@ -48,8 +48,10 @@ router.get('/calendars', asyncWrapper(async (req, res) => { // Get custom timezone and locale let localeUtils = null try { - const { oldTZ, newTZ } = JSON.parse(req.cookies['locale-utils']) - if (oldTZ && newTZ) localeUtils = { oldTZ, newTZ } + if (req.cookies?.['locale-utils']) { + const { oldTZ, newTZ } = JSON.parse(req.cookies['locale-utils']) + if (oldTZ && newTZ) localeUtils = { oldTZ, newTZ } + } } catch (e) { }