Skip to content

Commit

Permalink
fix issue with ical when location is not defined (yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-mauky committed Dec 11, 2023
1 parent 997548d commit a1e776b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/utils/create-ical.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,11 @@ export const createIcal = ({
}
} else {
const locationNode = locations.find((loc) => loc.fields.locationId === location)
icalLocation = {
title: locationNode.frontmatter.name,
address: `${locationNode.frontmatter.street} ${locationNode.frontmatter.number},${locationNode.frontmatter.zip} ${locationNode.frontmatter.city}`,
if(locationNode) {
icalLocation = {
title: locationNode.frontmatter.name,
address: `${locationNode.frontmatter.street} ${locationNode.frontmatter.number},${locationNode.frontmatter.zip} ${locationNode.frontmatter.city}`,
}
}
}

Expand Down

0 comments on commit a1e776b

Please sign in to comment.