From 90a04a9fcff526fc9001d7bf5fb86f222cb65eb1 Mon Sep 17 00:00:00 2001 From: Andrew Luca <1881266+iamandrewluca@users.noreply.github.com> Date: Tue, 25 Apr 2023 21:56:43 +0300 Subject: [PATCH] fix(server): default pluginOptions to empty object (#327) Not all Content-Types have the `pluginOptions`. Defaulting to a empty object, otherwise plugins fails when it loads --- server/services/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/services/common.ts b/server/services/common.ts index 8d993fc4..a629bd9c 100644 --- a/server/services/common.ts +++ b/server/services/common.ts @@ -93,7 +93,7 @@ const commonService: (context: StrapiContext) => ICommonService = ({ strapi }) = const { key, available } = value; const item = strapi.contentTypes[key]; const relatedField = (item.associations || []).find((_: ToBeFixed) => _.model === 'navigationitem'); - const { uid, options, info, collectionName, modelName, apiName, plugin, kind, pluginOptions } = item; + const { uid, options, info, collectionName, modelName, apiName, plugin, kind, pluginOptions = {} } = item; const { visible = true } = pluginOptions['content-manager'] || {}; const { name, description } = info; const { hidden, templateName, draftAndPublish } = options;