forked from GitHubMirrors/silverbullet-icalendar
fix(icalendar): Handle non-string rrule property gracefully
This commit is contained in:
@@ -154,6 +154,11 @@ export function expandRecurrences(icsEvent: any, windowDays = 365): any[] {
|
||||
const rruleStr = icsEvent.rrule || (icsEvent as any).recurrenceRule;
|
||||
if (!rruleStr) return [icsEvent];
|
||||
|
||||
if (typeof rruleStr !== "string") {
|
||||
console.warn(`[iCalendar] Invalid rrule type (${typeof rruleStr}) for event "${icsEvent.summary || "Untitled"}". Treating as non-recurring.`);
|
||||
return [icsEvent];
|
||||
}
|
||||
|
||||
try {
|
||||
const set = new RRuleSet();
|
||||
const cleanRule = rruleStr.replace(/^RRULE:/i, "");
|
||||
|
||||
Reference in New Issue
Block a user