From 081c865018e1cf0c45fa3bba27c9577a04c3c6fb Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Fri, 3 Apr 2026 03:15:55 +0200 Subject: [PATCH] fix: guard against undefined trigger in calendar event alert popover #143 --- components/calendar/event-detail-popover.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/calendar/event-detail-popover.tsx b/components/calendar/event-detail-popover.tsx index 86f1f19f..9518cabd 100644 --- a/components/calendar/event-detail-popover.tsx +++ b/components/calendar/event-detail-popover.tsx @@ -88,7 +88,7 @@ function formatDurationDisplay(minutes: number): string { function getAlertLabel(event: CalendarEvent, t: ReturnType): string | null { if (!event.alerts) return null; const first = Object.values(event.alerts)[0]; - if (!first || first.trigger["@type"] !== "OffsetTrigger") return null; + if (!first || !first.trigger || first.trigger["@type"] !== "OffsetTrigger") return null; const offset = first.trigger.offset; if (offset === "PT0S") return t("alerts.at_time"); const minMatch = offset.match(/-?PT?(\d+)M$/);