diff --git a/packages/backend/src/core/activitypub/models/ApEventService.ts b/packages/backend/src/core/activitypub/models/ApEventService.ts index 3a9117a77c..3382258d90 100644 --- a/packages/backend/src/core/activitypub/models/ApEventService.ts +++ b/packages/backend/src/core/activitypub/models/ApEventService.ts @@ -41,15 +41,19 @@ export class ApEventService { throw new Error('invalid type'); } - const title = note.name!; - const start = note.startTime!; - const end = note.endTime ?? null; + if (note.name && note.startTime) { + const title = note.name; + const start = note.startTime; + const end = note.endTime ?? null; - return { - title, - start, - end, - metadata: {}, - }; + return { + title, + start, + end, + metadata: {}, + }; + } else { + throw new Error('Invalid event properties') + } } }