diff --git a/packages/plugins/@nocobase/plugin-acl/src/server/server.ts b/packages/plugins/@nocobase/plugin-acl/src/server/server.ts index 9d1ad2fba3..98df996117 100644 --- a/packages/plugins/@nocobase/plugin-acl/src/server/server.ts +++ b/packages/plugins/@nocobase/plugin-acl/src/server/server.ts @@ -417,7 +417,10 @@ export class PluginACL extends Plugin { isThrough: true, sortable: false, }; - await this.db.getRepository('collections').create({ values: data }); + const r = this.db.getRepository('collections'); + if (r) { + await r.create({ values: data }); + } }); this.app.on('beforeInstallPlugin', async (plugin) => {