Skip to content

Commit

Permalink
Update calendar.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kernoeb committed Jan 19, 2024
1 parent c51a42f commit 6118e15
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/routes/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
}

Expand Down

0 comments on commit 6118e15

Please sign in to comment.