Skip to content

Commit

Permalink
fix(server): default pluginOptions to empty object (#327)
Browse files Browse the repository at this point in the history
Not all Content-Types have the `pluginOptions`. Defaulting to a empty object, otherwise plugins fails when it loads
  • Loading branch information
iamandrewluca authored Apr 25, 2023
1 parent faaf81c commit 90a04a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/services/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 90a04a9

Please sign in to comment.