diff --git a/packages/nocodb/src/services/calendars.service.ts b/packages/nocodb/src/services/calendars.service.ts index d718a82290..230fb76c16 100644 --- a/packages/nocodb/src/services/calendars.service.ts +++ b/packages/nocodb/src/services/calendars.service.ts @@ -46,8 +46,8 @@ export class CalendarsService { type: ViewTypes.CALENDAR, base_id: model.base_id, source_id: model.source_id, - created_by: param.user.id, - owned_by: param.ownedBy || param.user.id, + created_by: param.user?.id, + owned_by: param.ownedBy || param.user?.id, }, model, ); diff --git a/packages/nocodb/src/services/forms.service.ts b/packages/nocodb/src/services/forms.service.ts index 5f2ebfbb4e..1a2ee585e6 100644 --- a/packages/nocodb/src/services/forms.service.ts +++ b/packages/nocodb/src/services/forms.service.ts @@ -54,8 +54,8 @@ export class FormsService { type: ViewTypes.FORM, base_id: model.base_id, source_id: model.source_id, - created_by: param.user.id, - owned_by: param.ownedBy || param.user.id, + created_by: param.user?.id, + owned_by: param.ownedBy || param.user?.id, }, model, ); diff --git a/packages/nocodb/src/services/galleries.service.ts b/packages/nocodb/src/services/galleries.service.ts index 64df954498..a8d2281f13 100644 --- a/packages/nocodb/src/services/galleries.service.ts +++ b/packages/nocodb/src/services/galleries.service.ts @@ -47,8 +47,8 @@ export class GalleriesService { type: ViewTypes.GALLERY, base_id: model.base_id, source_id: model.source_id, - created_by: param.user.id, - owned_by: param.ownedBy || param.user.id, + created_by: param.user?.id, + owned_by: param.ownedBy || param.user?.id, }, model, ); diff --git a/packages/nocodb/src/services/maps.service.ts b/packages/nocodb/src/services/maps.service.ts index a22afe7c64..4d15b07bd4 100644 --- a/packages/nocodb/src/services/maps.service.ts +++ b/packages/nocodb/src/services/maps.service.ts @@ -42,8 +42,8 @@ export class MapsService { type: ViewTypes.MAP, base_id: model.base_id, source_id: model.source_id, - created_by: param.user.id, - owned_by: param.user.id, + created_by: param.user?.id, + owned_by: param.user?.id, }, model, );