diff --git a/pages/news-and-events/events/[eventId]/event-details/index.vue b/pages/news-and-events/events/[eventId]/event-details/index.vue index 048639b8..e2a9c6ab 100644 --- a/pages/news-and-events/events/[eventId]/event-details/index.vue +++ b/pages/news-and-events/events/[eventId]/event-details/index.vue @@ -15,7 +15,7 @@ {{ heroSummary }} -
+

Event Details

@@ -62,12 +62,11 @@ export default { async setup() { const route = useRoute() - const router = useRouter() try { const page = await getEventPage(route.params.eventId) - const eventDetailsItem = pathOr(null, ['fields','eventDetails'], page) - if (isEmpty(eventDetailsItem)) { - router.push(`/news-and-events/events/${route.params.eventId}`) + const eventDetailsItem = pathOr(null, ['fields', 'eventDetails'], page) + if (isEmpty(eventDetailsItem) || eventDetailsItem == null) { + navigateTo(`/news-and-events/events/${route.params.eventId}`, { redirectCode: 301 }) } return { page, @@ -115,8 +114,8 @@ export default { * Compute and convert the date the article was created * @returns {String} */ - updatedDate: function() { - return format(parseISO(this.eventDetailsItem.sys.updatedAt), 'MM/dd/yyyy') + updatedDate: function () { + return this.eventDetailsItem ? format(parseISO(this.eventDetailsItem?.sys.updatedAt), 'MM/dd/yyyy') : undefined }, breadcrumb: function() { return [