diff --git a/packages/core/src/service/services/channel.service.ts b/packages/core/src/service/services/channel.service.ts index b0b77bb7fb..05a60b5bb6 100644 --- a/packages/core/src/service/services/channel.service.ts +++ b/packages/core/src/service/services/channel.service.ts @@ -88,10 +88,13 @@ export class ChannelService { entityType: Type, entityId: ID, channelIds: ID[], - ): Promise { - const entity = await this.connection.getEntityOrThrow(ctx, entityType, entityId, { + ): Promise { + const entity = await this.connection.getRepository(ctx, entityType).findOne(entityId, { relations: ['channels'], }); + if (!entity) { + return; + } for (const id of channelIds) { entity.channels = entity.channels.filter(c => !idsAreEqual(c.id, id)); }